boris-vlasenko

среднее до двух знаков

Sep 25th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.12 KB | None | 0 0
  1. s = 0
  2. k = 0
  3. a = int(input())
  4. while a != 0:
  5.     s += a
  6.     k += 1
  7.     a = int(input())
  8. if k:
  9.     print("%6.2f" % round(s/k,2))
Advertisement
Add Comment
Please, Sign In to add comment