Aufgabe 4 implemented
parent
def1842083
commit
f2d22f41d4
17
Aufgabe 4.py
17
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")
|
||||
x = (math.pi*math.pi)/6
|
||||
reziprok(round(x,6))
|
||||
|
|
Loading…
Reference in New Issue