19 lines
290 B
Python
19 lines
290 B
Python
|
#!/usr/bin/env python
|
||
|
|
||
|
"""Algorithme : Calcule la factorielle d'un entier N positif"""
|
||
|
|
||
|
|
||
|
def main() -> None:
|
||
|
print(Factorielle(5))
|
||
|
|
||
|
|
||
|
def Factorielle(N : int) -> int:
|
||
|
if N == 1:
|
||
|
return 1
|
||
|
else:
|
||
|
return N * Factorielle(N - 1)
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|