Files
notes/CS1032/practical-2023-10-18/fn3.py
bluepython508 688d1ec426 Initial work
2023-11-01 08:55:40 +00:00

8 lines
150 B
Python

def exp(n, p):
if p == 0: return 1
return n * exp(n, p - 1)
base = float(input("Base? "))
power = int(input("Exponent? "))
print(exp(base, power))