Initial work
This commit is contained in:
7
CS1032/practical-2023-10-18/fn3.py
Normal file
7
CS1032/practical-2023-10-18/fn3.py
Normal file
@@ -0,0 +1,7 @@
|
||||
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))
|
||||
Reference in New Issue
Block a user