Created
May 15, 2017 17:08
-
-
Save LeoCavaille/6e2afd3b897ce6e16a63e5fc9d908c3f to your computer and use it in GitHub Desktop.
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 factorielle(n): | |
if n < 0: | |
raise ValueError("pas de factorielle pour les nombres negatifs") | |
result = 1 | |
for i in xrange(1, n+1): | |
result *= i | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment