Advertisement
bl00dt3ars

05. Christmas Gifts

Nov 14th, 2020
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. command = input()
  2. adult = 0
  3. kids = 0
  4. money_toys = 0
  5. money_swet = 0
  6. while command != "Christmas":
  7.     years = int(command)
  8.     if years <= 16:
  9.         kids += 1
  10.         money_toys = 5
  11.     elif years > 16:
  12.         adult += 1
  13.         money_swet = 15
  14.     command = input()
  15. total_money_toys = money_toys * kids
  16. total_money_swet = money_swet * adult
  17. if command == "Christmas":
  18.     print(f"Number of adults: {adult}")
  19.     print(f"Number of kids: {kids}")
  20.     print(f"Money for toys: {total_money_toys}")
  21.     print(f"Money for sweaters: {total_money_swet}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement