Commit 6646612a authored by Elisabeth Wenger's avatar Elisabeth Wenger
Browse files

Merge branch 'main' of https://git.mpib-berlin.mpg.de/krause/pytoy into main

parents 53f9254b 66e8a83c
......@@ -10,6 +10,7 @@ def fibonacci(n):
def naturalsquares(n):
"""return first n squares"""
return [x**2 for x in range(n)]
......
def fibonacci(n):
"""return first n fibonacci numbers"""
if n==0 or n==1:
return n
return fibonacci(n-1) + fibonacci(n-2)
......@@ -10,7 +11,7 @@ def pi(n):
for i in range(1,n+1):
pi -= (-1)**(i) * 4/j
j += 2
return pii
return pi
def factorial(n):
if n==0:
......
Supports Markdown
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