forked from tdwojak/Python2017
commited tasks
This commit is contained in:
parent
a0d2623f9f
commit
b353aee815
15
labs03/task02.py
Normal file
15
labs03/task02.py
Normal file
@ -0,0 +1,15 @@
|
||||
#task02
|
||||
#Fibonacci
|
||||
|
||||
def fibonacci(n):
|
||||
if n <= 1:
|
||||
return n
|
||||
else:
|
||||
return fibonacci(n-2) + fibonacci(n-1)
|
||||
|
||||
print(fibonacci(0))
|
||||
print(fibonacci(1))
|
||||
print(fibonacci(2))
|
||||
print(fibonacci(3))
|
||||
print(fibonacci(4))
|
||||
print(fibonacci(20))
|
Loading…
Reference in New Issue
Block a user