Search your topic here

Python program to find the exponentiation of a number

To write a Python program to find the exponentiation of a number. 

number = int(input(" Please Enter any Positive Integer : "))
exponent = int(input(" Please Enter Exponent Value : "))
power = 1

for i in range(1, exponent + 1):
    power = power * number
    
print("The Result of {0} Power {1} = {2}".format(number, exponent, power))


OUTPUT:

Please Enter any Positive Integer : 3
Please Enter Exponent Value : 2
The Result of 3 Power 2 = 9

LEAVE A REPLY