miglenabs

Untitled

Nov 28th, 2022
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. capacity = int(input())
  2.  
  3. is_full = False
  4. free_places = capacity
  5. price = 0
  6. total_income = 0
  7. input_line = input()
  8. while input_line != "Movie time!":
  9.     count_people = int(input_line)
  10.     free_places -= count_people
  11.     if count_people % 3 == 0:
  12.         price = (count_people * 5) - 5
  13.     else:
  14.         price = count_people * 5
  15.     total_income += price
  16.     if count_people >= free_places:
  17.         free_places = 0
  18.         flag = True
  19.         print("The cinema is full.")
  20.         print(f"Cinema income - {total_income} lv.")
  21.         break
  22.  
  23.     input_line = input()
  24.  
  25. if input_line == "Movie time!":
  26.     print(f"There are {free_places} seats left in the cinema.")
  27.     print(f"Cinema income - {total_income} lv.")
Advertisement
Add Comment
Please, Sign In to add comment