Advertisement
desislava_topuzakova

06. Cinema Tickets

Oct 16th, 2022
608
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. studentscounter = 0
  2. kidscounter = 0
  3. standardcounter = 0
  4. totalticketscounter = 0
  5. command = input()
  6. while command != "Finish":
  7. total_spaces = int(input())
  8. movie_name = command
  9. sold_movie_tickets = 0
  10. free_spaces = total_spaces
  11. while free_spaces > 0:
  12. ticket_type = input()
  13. if ticket_type == "End":
  14. break
  15. if ticket_type == "student":
  16. studentscounter += 1
  17. elif ticket_type == "standard":
  18. standardcounter += 1
  19. else:
  20. kidscounter += 1
  21. totalticketscounter += 1
  22. sold_movie_tickets += 1
  23. free_spaces-=1
  24. print(f"{command} - {sold_movie_tickets / total_spaces * 100:.2f}% full.")
  25. command = input()
  26. print(f"Total tickets: {totalticketscounter}")
  27. print(f"{(studentscounter/ totalticketscounter * 100):.2f}% student tickets.")
  28. print(f"{standardcounter/ totalticketscounter * 100:.2f}% standard tickets.")
  29. print(f"{kidscounter/ totalticketscounter * 100:.2f}% kids tickets.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement