Find the power of a number.

In this program, we will find the power of a number.

Steps to solve the program
  1. Take a number and power as input through the user.
  2. Create a variable and assign its value equal to 1.
  3. Multiply the created variable by the number.
  4. Repeat the above step to find out the power of the number using for loop with the range function.
  5. Print the output.
				
					num = int(input("Enter the number of which you have to find power: "))
pw = int(input("Enter the power: "))
result = 1

for n in range(pw):
    result = result * num

print(result)
				
			

Output :

				
					Enter the number of which you have to find power: 5
Enter the power: 4
625
				
			

enter a number and print it in words

find all factors of a number

Leave a Comment