ArifJan

Сумма ряда

Oct 18th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. n=int(input())
  2. seqSum=0.0
  3. i=1
  4. while i<=n:
  5. s=1.0/(i**2)
  6. seqSum +=s
  7. i=i+1
  8. if n==2:
  9. print(round(seqSum,2))
  10. elif n==1:
  11. print(round(seqSum))
  12. else:
  13. print(round(seqSum,5))
Add Comment
Please, Sign In to add comment