Sichanov

Untitled

Aug 14th, 2021
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. command = input()
  2.  
  3. student = 0
  4. standard = 0
  5. kid = 0
  6. total_tickets = 0
  7.  
  8. while command != "Finish":
  9.     movie_name = command
  10.     seats = int(input())
  11.     sold_tickets_per_movie = 0
  12.     ticket = input()
  13.     while ticket != "End":
  14.         sold_tickets_per_movie += 1
  15.         total_tickets += 1
  16.         if ticket == "student":
  17.             student += 1
  18.         elif ticket == "standard":
  19.             standard += 1
  20.         elif ticket == "kid":
  21.             kid += 1
  22.         if sold_tickets_per_movie == seats:
  23.             break
  24.         ticket = input()
  25.     percent_filled_hall = sold_tickets_per_movie / seats * 100
  26.     print(f"{movie_name} - {percent_filled_hall:.2f}% full.")
  27.  
  28.     command = input()
  29.  
  30. print(f"Total tickets: {total_tickets}")
  31. print(f"{student / total_tickets * 100:.2f}% student tickets.")
  32. print(f"{standard / total_tickets * 100:.2f}% standard tickets.")
  33. print(f"{kid / total_tickets * 100:.2f}% kids tickets.")
  34.  
  35.  
Advertisement
Add Comment
Please, Sign In to add comment