Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name_film = ''
- all_film_billets = 0
- allpr_stud = 0
- allpr_stan = 0
- allpr_kid = 0
- while name_film != 'Finish':
- name_film = input()
- free_seats = int(input())
- bilet = ''
- count1 = 0
- count2 = 0
- count3 = 0
- pr_buy = 0
- all_billets = 0
- while bilet != 'End':
- bilet = input()
- if bilet == 'student':
- count1 += 1
- if bilet == 'standard':
- count2 += 1
- if bilet == 'kid':
- count3 += 1
- if free_seats <= all_billets:
- break
- all_billets = count1 + count2 + count3
- pr_buy = all_billets / free_seats * 100
- all_film_billets += all_billets
- allpr_stud += count1
- allpr_stan += count2
- allpr_kid += count3
- print(f"{name_film} - {pr_buy:.2f}% full.")
- if bilet == 'Finish':
- allpr_stud = allpr_stud / all_film_billets * 100
- allpr_stan = allpr_stan / all_film_billets * 100
- allpr_kid = allpr_kid / all_film_billets * 100
- print(f"Total tickets: {all_film_billets}")
- print(f"{allpr_stud:.2f}% student tickets.")
- print(f"{allpr_stan:.2f}% standard tickets.")
- print(f"{allpr_kid:.2f}% kids tickets.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement