Last active
September 26, 2020 15:31
-
-
Save glassus/de73e52a753f58e2e29e2ebad5a09871 to your computer and use it in GitHub Desktop.
fact.py
This file contains 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 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