Commit 99c36d37 authored by Michael Krause's avatar Michael Krause 🎉
Browse files

Fix factorial: use recursive implementation

parent 58e1830d
Pipeline #1510 failed with stages
in 30 seconds
......@@ -13,7 +13,6 @@ def pi(n):
return pii
def factorial(n):
r = 1
for i in range(n+1):
r *= i
return r
if n==0:
return 0
return n*factorial(n-1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment