Created
March 29, 2017 01:53
-
-
Save afzafri/43143aeb8854e0c6b2869df3eb520ba3 to your computer and use it in GitHub Desktop.
Just an example of recursive function. For my future references.
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 genFib(a,b,i): | |
if i == 10: | |
return 0 | |
c = b + a | |
a = b | |
b = c | |
print(c) | |
i = i + 1 | |
genFib(a,b,i) | |
i = 2 | |
a = 1 | |
b = 2 | |
print(a) | |
print(b) | |
genFib(a,b,i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment