Advertisement
simeonshopov

Cinema (june exam)

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