Advertisement
exDotaPro

15_june_2019_5_series

Jan 21st, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. budget = float(input())
  2. series_count = int(input())
  3.  
  4. total = 0
  5.  
  6. for series in range(series_count):
  7.     series_title = input()
  8.     series_price = float(input())
  9.  
  10.     if series_title == 'Thrones':
  11.         series_price *= 0.50
  12.     elif series_title == 'Lucifer':
  13.         series_price *= 0.60
  14.     elif series_title == 'Protector':
  15.         series_price *= 0.70
  16.     elif series_title == 'TotalDrama':
  17.         series_price *= 0.80
  18.     elif series_title == 'Area':
  19.         series_price *= 0.90
  20.  
  21.     total += series_price
  22.  
  23. diff = abs(budget - total)
  24.  
  25. if budget >= total:
  26.     print(f'You bought all the series and left with {diff:.2f} lv.')
  27. else:
  28.     print(f'You need {diff:.2f} lv. more to buy the series!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement