notebook.community
Edit and run
In [3]: def exp(b, n): if n == 0: return 1 else: return b * exp(b, n - 1) b, n = int(input('Enter a number: ').strip()), int(input('Enter a power: ').strip()) print('Result:',exp(b, n))
def exp(b, n): if n == 0: return 1 else: return b * exp(b, n - 1) b, n = int(input('Enter a number: ').strip()), int(input('Enter a power: ').strip()) print('Result:',exp(b, n))
Enter a number: 2 Enter a power: 4 Result: 16