Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- price_ticket = 5
- discount = 0
- total_discount = 0
- in_visitors = 0
- house_capacity = int(input())
- check_visitors = house_capacity
- while True:
- count_visitors = input()
- if count_visitors == "Movie time!":
- break
- num_count_visitors = int(count_visitors)
- in_visitors = in_visitors + num_count_visitors
- check_visitors = check_visitors - num_count_visitors
- if not num_count_visitors % 3:
- # discount = 5
- total_discount = total_discount + 5
- if check_visitors < 0:
- check_visitors = 0
- in_visitors = house_capacity
- break
- total_revenue = in_visitors * price_ticket - total_discount
- if count_visitors == 'Movie time!':
- print(f"There are {check_visitors} seats left in the cinema.")
- print(f"Cinema income - {total_revenue} lv.")
- elif check_visitors == 0:
- print(f"The cinema is full.")
- print(f"Cinema income - {total_revenue} lv.")
Add Comment
Please, Sign In to add comment