python基础一 day18 作业
def find(index):
if index in [1,2]:
return 1
return find(index-1)+find(index-1)
print(find(5))
#
def find(index,l=[0]):
l[0]+=1
if index==2:
l[0]-=1
return 1,1
else:
a,b=find(index-1)
l[0] -= 1
if l[0]==0:
return b+a
return b,b+a
print(find(6))
def jc(n):
if n==1:
return 1
else:
return n*jc(n-1)
print(jc(5))