Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #John Wallis
- #PI
- #http://www.maths.tcd.ie/pub/HistMath/People/Wallis/RouseBall/wallispi.gif
- Anzahl = int(input("Anzahl Versuche : "))
- Nenner = 1
- Zaehler = 0
- Produkt = 2
- i = 0
- while i <= Anzahl:
- if i % 2 == 0:
- Zaehler = Zaehler + 2
- else:
- Nenner = Nenner + 2
- i = i + 1
- Produkt = Produkt * (Zaehler / Nenner)
- print(Produkt)
Advertisement
Add Comment
Please, Sign In to add comment