Commit 0730fb5b by BellCodeEditor

save project

parent 5b39b6b5
Showing with 11 additions and 1 deletions
def func(n):
if n<=2:
return 1
if n>2:
value = func(n-1) + func(n-2)
return value
a = func(2)
print(a)
\ No newline at end of file
...@@ -3,5 +3,5 @@ def sun_numbers(num): ...@@ -3,5 +3,5 @@ def sun_numbers(num):
return 1 return 1
temp = sun_numbers(num - 1) temp = sun_numbers(num - 1)
return num + temp return num + temp
result = sun_numbers(100) result = sun_numbers(1)
print(result) print(result)
\ 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