Write a program to find exponentiation power of a number.


Write a program to find exponentiation(power of a number).

  1. def Power(para1,para2):
        ans=1
        for i in range(para2):
          ans*=para1
        return ans
    x=eval(input("Enter first parameter x: "))
    y=eval(input("Enter second parameter y: "))
    print("x^y is ",Power(x,y))

Output:-


Post a Comment

0 Comments