Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763)

* Renaming directories
* Adding a recursive factorial algorithm
This commit is contained in:
Vysor 2019-04-23 00:53:56 +10:00 committed by John Law
parent 48bba495ae
commit df04d94543
36 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
def fact(n):
"""
Return 1, if n is 1 or below,
otherwise, return n * fact(n-1).
"""
return 1 if n <= 1 else n * fact(n-1)
"""
Shown factorial for i,
where i ranges from 1 to 20.
"""
for i in range(1,21):
print(i, ": ", fact(i), sep='')