Computer Science, asked by grraj9511, 10 months ago

write a program that uses a method power ()

Answers

Answered by fiercespartan
3

There is no function as power() in python but to have an exponent, we use the function pow()

________________________________________

If we have the program like pow(2,3), it returns 2^3 or 2**3 in python. If we want to get an exponent, we use ' ** ' in python.

________________________________________

But, if we want to make a definition name power(), here is how:

def power(base,exponent):

   return base**exponent

________________________________________

def power(base,exponent):

   return power(base,exponent)

_______________________________________

Similar questions