Commit 6350d49a by BellCodeEditor

save project

parent 0f53c1f3
Showing with 30 additions and 0 deletions
def sum(n):
def sum(n):
res = 0
for i in range(1,n+1):
res = res + i
return res
def sum2(n):
if n == 1:
return 1
return n+sum2(n-1)
print(sum2(21))
def func(n):
def func(n):
if n == 0:
return 0
if n == 1:
return 1
return func(n-1) + func(n-2)
month = 0
while func(month)<20:
month = momth + 1
print(month)
print(func(month))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment