Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.21 KB | None | 0 0
  1. name_film = ''
  2. all_film_billets = 0
  3. allpr_stud = 0
  4. allpr_stan = 0
  5. allpr_kid = 0
  6.  
  7. while name_film != 'Finish':
  8.     name_film = input()
  9.     free_seats = int(input())
  10.     bilet = ''
  11.     count1 = 0
  12.     count2 = 0
  13.     count3 = 0
  14.     pr_buy = 0
  15.     all_billets = 0
  16.  
  17.     while bilet != 'End':
  18.         bilet = input()
  19.         if bilet == 'student':
  20.             count1 += 1
  21.         if bilet == 'standard':
  22.             count2 += 1
  23.         if bilet == 'kid':
  24.             count3 += 1
  25.  
  26.         if free_seats <= all_billets:
  27.                 break
  28.         all_billets = count1 + count2 + count3
  29.         pr_buy = all_billets / free_seats * 100
  30.  
  31.     all_film_billets += all_billets
  32.  
  33.     allpr_stud += count1
  34.     allpr_stan += count2
  35.     allpr_kid += count3
  36.  
  37.     print(f"{name_film} - {pr_buy:.2f}% full.")
  38.     if bilet == 'Finish':
  39.         allpr_stud = allpr_stud / all_film_billets * 100
  40.         allpr_stan = allpr_stan / all_film_billets * 100
  41.         allpr_kid = allpr_kid / all_film_billets * 100
  42.  
  43.         print(f"Total tickets: {all_film_billets}")
  44.         print(f"{allpr_stud:.2f}% student tickets.")
  45.         print(f"{allpr_stan:.2f}% standard tickets.")
  46.         print(f"{allpr_kid:.2f}% kids tickets.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement