Created
July 20, 2017 05:43
-
-
Save aoirint/4eb50ccc9be488c976a48f53ae33162b to your computer and use it in GitHub Desktop.
Pythonでフィボナッチ数列のテスト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fibo(i): | |
if i == 1: | |
return 0 | |
if i == 2: | |
return 1 | |
return fibo(i-1) + fibo(i-2) | |
for i in range(1, 31): | |
print(fibo(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment