Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- budget = float(input())
- count_series = int(input())
- # за всеки сериал:
- # име
- # цена
- # проверка дали има отстъпка
- # добавяме цената към общата сума
- # проверка дали бюджетът ми покрива сумата за филмите
- spend_money = 0
- for serial in range(1, count_series + 1):
- name = input()
- price = float(input())
- if name == 'Thrones':
- price = price - 0.50 * price
- # price = 0.50 * price
- elif name == 'Lucifer':
- price = price - 0.40 * price
- # price = 0.60 * price
- elif name == 'Protector':
- price = price - 0.30 * price
- # price = 0.70 * price
- elif name == 'TotalDrama':
- price = price - 0.20 * price
- # price = 0.80 * price
- elif name == 'Area':
- price = price - 0.10 * price
- spend_money += price
- # проверка дали парите стигат
- if budget >= spend_money:
- left_money = budget - spend_money
- print(f'You bought all the series and left with {left_money:.2f} lv.')
- else:
- need_money = spend_money - budget
- print(f'You need {need_money:.2f} lv. more to buy the series!')
Advertisement
Add Comment
Please, Sign In to add comment