Commit 33bd7858 authored by Michael Krause's avatar Michael Krause 🎉
Browse files

Fix factorial: use recursive implementation

parent 63d99622
......@@ -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