Spocoman

Cinema Tickets

Jan 5th, 2022 (edited)
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. standard_tickets = 0
  2. student_tickets = 0
  3. kid_tickets = 0
  4. movie = input()
  5.  
  6. while movie != 'Finish':
  7.     seats = int(input())
  8.     counter = 0
  9.     for i in range(seats):
  10.         category = input()
  11.         if category == 'End':
  12.             break
  13.         if category == 'student':
  14.             student_tickets += 1
  15.         elif category == 'standard':
  16.             standard_tickets += 1
  17.         else:
  18.             kid_tickets += 1
  19.         counter += 1
  20.  
  21.     print(f'{movie} - {counter / seats * 100:.2f}% full.')
  22.     movie = input()
  23.  
  24. total_tickets = standard_tickets + student_tickets + kid_tickets
  25. print(f'Total tickets: {total_tickets}')
  26. print(f'{student_tickets / total_tickets * 100:.2f}% student tickets.')
  27. print(f'{standard_tickets / total_tickets * 100:.2f}% standard tickets.')
  28. print(f'{kid_tickets / total_tickets * 100:.2f}% kids tickets.')
  29.  
Add Comment
Please, Sign In to add comment