BbJLeB

04. Christmas Gifts

May 15th, 2019
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. moneyForToys = 0
  2. kidsCount = 0
  3. moneyForSweaters = 0
  4. adultsCount = 0
  5. command = input()
  6.  
  7. while not "Christmas" == command:
  8.     years = int(command)
  9.     if years <= 16:
  10.         moneyForToys += 5
  11.         kidsCount += 1
  12.     else:
  13.         moneyForSweaters += 15
  14.         adultsCount += 1
  15.     command = input()
  16.  
  17. print(f"Number of adults: {adultsCount}")
  18. print(f"Number of kids: {kidsCount}")
  19. print(f"Money for toys: {moneyForToys}")
  20. print(f"Money for sweaters: {moneyForSweaters}")
Advertisement
Add Comment
Please, Sign In to add comment