Calculating power using base and exponent

Report a typo

Write a program that takes a base and an exponent as input and prints the result of raising the base to the power of the exponent. The program should read the base and exponent from the user as integers, calculate the result using the pow() function, and print the final value.

Sample Input 1:

2
3

Sample Output 1:

8

Sample Input 2:

5
2

Sample Output 2:

25
Write a program in Python 3
# Import the necessary function

base = int(input())
exponent = int(input())

# Use the pow() function to calculate the result

print(result)

Create a free account to access the full topic