11 lines
350 B
Python
11 lines
350 B
Python
import math
|
|
if __name__ == "__main__":
|
|
# 4.1
|
|
series_value = round(math.pi**2/6, 6)
|
|
approximate_value = 0
|
|
divider = 1
|
|
while series_value != round(approximate_value, 6):
|
|
approximate_value += 1/divider**2
|
|
divider += 1
|
|
print("The sum equals", series_value, "after adding", divider-1, "reciprocal square numbers.")
|