#递归实现
def power2(m,n):
if n<21:
m*=2
n+=1
return power2(m,n)
else:
return m
print(power2(1,1))
#非递归实现
result=1
for i in range(20):
result*=2
print(result)
#递归实现
def power2(m,n):
if n<21:
m*=2
n+=1
return power2(m,n)
else:
return m
print(power2(1,1))
#非递归实现
result=1
for i in range(20):
result*=2
print(result)