fork download
  1. # your code goes here
  2. #0JLQsNGB0LjQu9C10L3QutC+INCQ0YDRgtC10Lwg
  3. #число фібаначі
  4.  
  5. def Fibanachi(n):
  6. result =[]
  7. if n == 1:
  8. result = [0]
  9. elif n == 2:
  10. result = [0,1]
  11. else:
  12. result = [0,1]
  13. for j in range(2,n):
  14. result.append(result[j-1] + result[j-2])
  15. return result
  16.  
  17. for i in Fibanachi(10):
  18. print(i)
Success #stdin #stdout 0.13s 14172KB
stdin
Standard input is empty
stdout
0
1
1
2
3
5
8
13
21
34