ALEXANDAR_GEORGIEV

cinema_ticket

May 19th, 2022 (edited)
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. price_ticket = 5
  2. discount = 0
  3. total_discount = 0
  4. in_visitors = 0
  5. house_capacity = int(input())
  6. check_visitors = house_capacity
  7. while True:
  8.     count_visitors = input()
  9.     if count_visitors == "Movie time!":
  10.         break
  11.     num_count_visitors = int(count_visitors)
  12.     in_visitors = in_visitors + num_count_visitors
  13.     check_visitors = check_visitors - num_count_visitors
  14.  
  15.     if not num_count_visitors % 3:
  16.         discount = 5
  17.         total_discount = total_discount + 5
  18.     if check_visitors <= 0:
  19.         in_visitors = house_capacity
  20.         break
  21. total_revenue = in_visitors * price_ticket - total_discount
  22. if count_visitors == 'Movie time!':
  23.     print(f"There are {check_visitors} seats left in the cinema.")
  24.     print(f"Cinema income - {total_revenue} lv.")
  25. elif check_visitors <= 0:
  26.     print(f"The cinema is full.")
  27.     print(f"Cinema income - {total_revenue} lv.")
Add Comment
Please, Sign In to add comment