Teo_Yanchev

Series (15-16/06/2019)

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