yordan_yordanov

Задача №5

Jul 18th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. product = input().lower()
  2. town = input().lower()
  3. quantity = float(input())
  4. result = 0
  5.  
  6. if town == "sofia":
  7. if product == 'coffee':
  8. result = quantity * 0.50
  9. elif product == 'water':
  10. result = quantity * 0.80
  11. elif product == 'beer':
  12. result = quantity * 1.20
  13. elif product == 'sweets':
  14. result = quantity * 1.45
  15. elif product == 'peanuts':
  16. result = quantity * 1.60
  17.  
  18.  
  19. elif town == "plovdiv":
  20. if product == 'coffee':
  21. result = quantity * 0.40
  22. elif product == 'water':
  23. result = quantity * 0.70
  24. elif product == 'beer':
  25. result = quantity * 1.15
  26. elif product == 'sweets':
  27. result = quantity * 1.30
  28. elif product == 'peanuts':
  29. result = quantity * 1.50
  30.  
  31.  
  32. elif town == "varna":
  33. if product == 'coffee':
  34. result = quantity * 0.45
  35. elif product == 'water':
  36. result = quantity * 0.70
  37. elif product == 'beer':
  38. result = quantity * 1.10
  39. elif product == 'sweets':
  40. result = quantity * 1.35
  41. elif product == 'peanuts':
  42. result = quantity * 1.55
  43.  
  44. print("{0:.2f}".format(result))
Advertisement
Add Comment
Please, Sign In to add comment