Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. seats = int(input())
  2. people_sum = 0
  3. money = 0
  4. while True:
  5. try:
  6. visitors = int(input())
  7. people_sum += visitors
  8.  
  9. if people_sum > seats:
  10. print("")
  11. print("The cinema is full.")
  12. print(f"Cinema income - {money} lv.")
  13. break
  14.  
  15. if visitors % 3 == 0:
  16. money += (visitors * 5) - 5
  17. else:
  18. money += visitors * 5
  19.  
  20. except ValueError:
  21.  
  22. print(f"There are {seats - people_sum} seats left in the cinema.")
  23. print(f"Cinema income - {money} lv.")
  24. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement