Python Program to find Power of a number
Find Power of a Number
Calculation: 5 * 5
Step 1. Take user input for base number.
Step 2. Take user input for exponential, the power of the number.
Step 3. Take temp variable and initialized with 1.
Step 4. Initialize For loop, starts from 0 to expo value.
Step 5. Inside for loop, perform arithmetic multiplication operations between temp and base. And store value in temp variable.
Step 6. Finally, Print temp variable.
Step 7. Stop
base = int(input("Enter Base number:")) expo = int(input("Enter Expo Number:")) temp = 1 for i in range(0, expo): temp = temp * base print(temp) # This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student)
Enter Base number: 2
Enter Expo Number: 4