XJTU_Python/homework/2/14.py

9 lines
100 B
Python

ans = 0
a = 2
b = 1
for i in range(20):
ans += a/b
a = a+b
b = a-b
print(round(ans, 2))