simeonshopov

Series (june exam)

Nov 7th, 2019
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. budget = float(input())
  2. series_count = int(input())
  3.  
  4. for i in range(series_count):
  5.   name = input()
  6.   price = float(input())
  7.   if name == "Thrones":
  8.     price *= 0.5
  9.   elif name == "Lucifer":
  10.     price *= 0.6
  11.   elif name == "Protector":
  12.     price *= 0.7
  13.   elif name == "TotalDrama":
  14.     price *= 0.8
  15.   elif name == "Area":
  16.     price *= 0.9
  17.   budget -= price
  18.  
  19. if budget >= 0:
  20.   print(f"You bought all the series and left with {budget:.2f} lv.")
  21. else:
  22.   print(f"You need {abs(budget):.2f} lv. more to buy the series!")
Advertisement
Add Comment
Please, Sign In to add comment