Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- student_tickets = 0
- standard_tickets = 0
- kids_tickets = 0
- line = input()
- while line != "Finish":
- movie_name = line
- free_spaces = int(input())
- bought_tickets = 0
- ticket_type = input()
- while ticket_type != "End":
- if ticket_type == "student":
- student_tickets += 1
- elif ticket_type == "standard":
- standard_tickets += 1
- else:
- kids_tickets += 1
- bought_tickets += 1
- if bought_tickets == free_spaces:
- break
- ticket_type = input()
- movie_percentage = bought_tickets / free_spaces * 100
- print(f"{movie_name} - {movie_percentage:.2f}% full.")
- line = input()
- total_tickets = student_tickets + standard_tickets + kids_tickets
- print(f"Total tickets: {total_tickets}")
- print(f"{student_tickets / total_tickets * 100:.2f}% student tickets.")
- print(f"{standard_tickets / total_tickets * 100:.2f}% standard tickets.")
- print(f"{kids_tickets / total_tickets * 100:.2f}% kids tickets.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement