From f2d22f41d4152fb45eaef026bbac12796ea44b5c Mon Sep 17 00:00:00 2001 From: Thomas <2121321@hs-mannheim.de> Date: Wed, 9 Nov 2022 10:21:49 +0100 Subject: [PATCH] Aufgabe 4 implemented --- Aufgabe 4.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Aufgabe 4.py b/Aufgabe 4.py index 78ce1f4..4817317 100644 --- a/Aufgabe 4.py +++ b/Aufgabe 4.py @@ -1,2 +1,17 @@ +import math +def reziprok(x): + check = True + summe = 0 + + i = 1 + while(check): + summe+= 1/(i*i) + i += 1 + if(round(summe,6) == x): + check = False + print(f"Number of runs: {i}" ) + print(f"π^2/6: {x}") + if __name__ == '__main__': - print("test") \ No newline at end of file + x = (math.pi*math.pi)/6 + reziprok(round(x,6))