Advertisement
mbstanchev

ticket

Feb 14th, 2022
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. name_of_movie = input()
  2. student = 0
  3. standart = 0
  4. kid = 0
  5. total_couter = 0
  6. while name_of_movie != "Finish":
  7. seats_in_theatre = int(input())
  8. sold_seats = 0
  9. curent_counter = 1
  10. capasiaty = 0
  11. while curent_counter <= seats_in_theatre:
  12. type_of_ticket = input()
  13. if type_of_ticket == "End":
  14. break
  15. elif type_of_ticket == "student":
  16. student += 1
  17. elif type_of_ticket == "standard":
  18. standart += 1
  19. elif type_of_ticket == "kid":
  20. kid += 1
  21. curent_counter += 1
  22. total_couter += 1
  23. sold_seats += student + standart + kid
  24. capasiaty = sold_seats / seats_in_theatre * 100
  25. print(f"{name_of_movie} - {capasiaty:.2f}% full.")
  26. name_of_movie = input()
  27. student_procent = student / total_couter * 100
  28. standart_procent = standart / total_couter * 100
  29. kid_procent = kid / total_couter * 100
  30.  
  31. print(f"Total tickets: {total_couter}")
  32. print(f"{student_procent:.2f}% student tickets.")
  33. print(f"{standart_procent:.2f}% standard tickets.")
  34. print(f"{kid_procent:.2f}% kids tickets.")
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement