Giving input x and n just need to find the exponential value

Viewed 32

With constraints being (0 <= x <= 8, 0 <= n <= 9) Output should be x^n (i.e. x raised to the power n) I am getting error in here . Cant understand why

n_input = input()
given_input = n_input.split(" ")
x = int(given_input[0])
n = int(given_input[1])
if (0<=x<=8 and 0<=n<=9):
    output = x**n
    print(output)
else:
    print("Values of x and n exceeding constraints")
0 Answers
Related