Explain pow(x, y) in python with example.
Answers
Answered by
0
pow() in Python
Python offers to compute the power of a number and hence can make task of calculating power of a number easier. It has many-fold applications in day to day programming.
Naive Method to compute power :
# Python code to demonstrate naive method
# to compute power
n = 1
for i in range(1,5):
n=3*n
print ("The value of 3**4 is : ",end="")
print (n)
Output :
Similar questions