Advertisement
ALEXANDAR_GEORGIEV

cinema_ticket

Jun 2nd, 2022
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. check_free_seats = 0
  2. # check_end = False
  3. statistic = []
  4. film ={}
  5. while True:
  6.     name_film = input()
  7.     if name_film == 'Finish':
  8.         break
  9.     free_seats = int(input())
  10.     check_free_seats = free_seats
  11.  
  12.     while True:
  13.         type_ticket = input()
  14.         if type_ticket == 'End' or check_free_seats < 1:
  15.             percent = ((film['student'] + film['standard'] + film['kid']) / free_seats) * 100
  16.             print(f"{name_film} - {percent:.2f}% full.")
  17.             break
  18.         film['name'] = name_film
  19.         if type_ticket == 'student':
  20.             film['student'] += 1
  21.         elif type_ticket == 'standard':
  22.             film['standard'] += 1
  23.         elif type_ticket == 'kid':
  24.             film['kid'] += 1
  25.         check_free_seats -= 1
  26.     statistic.append(film)
  27.     print(statistic)
  28.  
  29. print(statistic)
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement