Advertisement
first_periscope

Как рассчитать счастье человека.

Mar 15th, 2023
675
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | Source Code | 0 0
  1. def happiness_level(age):
  2.     if age >= 0 and age <= 20:
  3.         return 80
  4.     elif age >= 21 and age <= 35:
  5.         return 70
  6.     elif age >= 36 and age <= 50:
  7.         return 60
  8.     elif age >= 51 and age <= 65:
  9.         return 50
  10.     elif age >= 66 and age <= 80:
  11.         return 40
  12.     elif age >= 81 and age <= 100:
  13.         return 30
  14.     else:
  15.         return None
  16.  
  17. age = 91
  18. happiness = happiness_level(age)
  19. print(happiness)
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement