Spocoman

World Snooker Championship

Feb 13th, 2022 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.92 KB | None | 0 0
  1. championship = input()
  2. type_of_ticket = input()
  3. tickets_count = int(input())
  4. trophy_selfie = input()
  5. ticket_price = 0
  6.  
  7. if championship == "Quarter final":
  8.     if type_of_ticket == "Standard":
  9.         ticket_price = 55.50
  10.  
  11.     elif type_of_ticket == "Premium":
  12.         ticket_price = 105.20
  13.  
  14.     elif type_of_ticket == "VIP":
  15.         ticket_price = 118.90
  16.  
  17. elif championship == "Semi final":
  18.     if type_of_ticket == "Standard":
  19.         ticket_price = 75.88
  20.  
  21.     elif type_of_ticket == "Premium":
  22.         ticket_price = 125.22
  23.  
  24.     elif type_of_ticket == "VIP":
  25.         ticket_price = 300.40
  26.  
  27. elif championship == "Final":
  28.     if type_of_ticket == "Standard":
  29.         ticket_price = 110.10
  30.  
  31.     elif type_of_ticket == "Premium":
  32.         ticket_price = 160.66
  33.  
  34.     elif type_of_ticket == "VIP":
  35.         ticket_price = 400
  36.  
  37. total_price = ticket_price * tickets_count
  38.  
  39. if total_price > 4000:
  40.     total_price *= 0.75
  41.     trophy_selfie = "N"
  42.  
  43. elif total_price > 2500:
  44.     total_price *= 0.9
  45.  
  46. if trophy_selfie == "Y":
  47.     total_price += tickets_count * 40
  48.  
  49. print(f"{total_price:.2f}")
  50.  
  51.  
  52. РЕШЕНИЕ С ТЕРНАРЕН ОПЕРАТОР:
  53.  
  54. championship = input()
  55. type_of_ticket = input()
  56. tickets_count = int(input())
  57.  
  58. total_price = ((55.50 if type_of_ticket == "Standard" else 105.20 if type_of_ticket == "Premium" else 118.90)
  59.                if championship == "Quarter final" else
  60.                (75.88 if type_of_ticket == "Standard" else 125.22 if type_of_ticket == "Premium" else 300.40)
  61.                if championship == "Semi final" else
  62.                (110.10 if type_of_ticket == "Standard" else 160.66 if type_of_ticket == "Premium" else 400)) * tickets_count
  63.  
  64. trophy_selfie = "N" if total_price > 4000 else input()
  65.  
  66. total_price *= 0.75 if total_price > 4000 else 0.9 if total_price > 2500 else 1
  67.  
  68. total_price += tickets_count * 40 if trophy_selfie == "Y" else 0
  69.  
  70. print(f"{total_price:.2f}")
  71.  
  72.  
Add Comment
Please, Sign In to add comment