pow() function belongs to which library in python
Answers
Answered by
1
C library function - pow()
The pow() function returns the value of x to the power of y (xy). If a third parameter is present, it returns x to the power of y, modulus z.
Answered by
0
Answer:
pow() function belongs to the standard math library in python.
Explanation:
- pow() is used for calculating the power of the number within the specified range. With the pow function, we can calculate the square, cube, square root, and power to any other number.
- It is the part of the standard math library in python.
- However, there is one alternative operator present in Python that can be used in place of the pow() function.
- This operator is known as the exponential operator and it is denoted by the double star ( ** ).
- It can also calculate the power of the given number.
- It is used as follows:
a = int(input("Enter any number"))
b = int(input("Enter the power of the number"))
result = a ** b
print(result)
This code will calculate the power of a to b. This operator is better since it requires no additional library.
#SPJ3
Similar questions