You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
199 B
Python
11 lines
199 B
Python
5 years ago
|
def power(a,b):
|
||
|
if b==0:
|
||
|
return 1
|
||
|
elif a==0:
|
||
|
return 0
|
||
|
elif b==1:
|
||
|
return a
|
||
|
else:
|
||
|
return a*power(a,b-1)
|
||
|
|
||
|
print(power(3,4))
|