Skip to content

Instantly share code, notes, and snippets.

@glassus
Last active September 26, 2020 15:31
Show Gist options
  • Save glassus/de73e52a753f58e2e29e2ebad5a09871 to your computer and use it in GitHub Desktop.
Save glassus/de73e52a753f58e2e29e2ebad5a09871 to your computer and use it in GitHub Desktop.
fact.py
def factorielle_imp(n):
p = 1
for k in range(1,n+1):
p = p * k
return p
def factorielle_rec(n):
if n == 1 :
return 1
else :
return n * factorielle_rec(n-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment