Skip to content

Instantly share code, notes, and snippets.

@afzafri
Created March 29, 2017 01:53
Show Gist options
  • Save afzafri/43143aeb8854e0c6b2869df3eb520ba3 to your computer and use it in GitHub Desktop.
Save afzafri/43143aeb8854e0c6b2869df3eb520ba3 to your computer and use it in GitHub Desktop.
Just an example of recursive function. For my future references.
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