Advertisement
Spocoman

Cinema

Feb 10th, 2022 (edited)
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. seats = int(input())
  2. command = input()
  3. income = 0
  4.  
  5. while command != "Movie time!":
  6.     visitors = int(command)
  7.     if visitors > seats:
  8.         break
  9.     seats -= visitors
  10.     income += visitors * 5
  11.     if visitors % 3 == 0:
  12.         income -= 5
  13.     command = input()
  14.  
  15. if command == "Movie time!":
  16.     print(f"There are {seats} seats left in the cinema.")
  17. else:
  18.     print("The cinema is full.")
  19.  
  20. print(f"Cinema income - {income} lv.")
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement