Advertisement
k1alo

Средний возраст

Oct 26th, 2023
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. ages = [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]
  2. count = 0
  3. total = 0
  4.  
  5. for i in ages:
  6.     if 30 <= i <= 40:
  7.         count += 1
  8.         total += i
  9. medium_age = total // count
  10. print("Средний возраст:", medium_age)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement