Advertisement
Guest User

Untitled

a guest
May 27th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. town = input().lower()
  2. product = input().lower()
  3. quantify = float(input())
  4. price = -1.0
  5. if town == 'Sofia':
  6. if product == 'coffee':
  7. price = 0.5 * quantify
  8. elif product == 'water':
  9. price = 0.8 * quantify
  10. elif product == 'beer':
  11. price = 1.20 * quantify
  12. elif product == 'sweets':
  13. price = 1.45 * quantify
  14. elif product == 'peanuts':
  15. price = 1.60 * quantify
  16.  
  17. elif town == 'Plovdiv':
  18. if product == 'coffee':
  19. price = 0.40 * quantify
  20. elif product == 'water':
  21. price = 0.70 * quantify
  22. elif product == 'beer':
  23. price = 1.15 * quantify
  24. elif product == 'sweets':
  25. price = 1.30 * quantify
  26. elif product == 'peanuts':
  27. price = 1.50 * quantify
  28.  
  29. elif town == 'Varna':
  30. if product == 'coffee':
  31. price = 0.45 * quantify
  32. elif product == 'water':
  33. price = 0.70 * quantify
  34. elif product == 'beer':
  35. price = 1.10 * quantify
  36. elif product == 'sweets':
  37. price = 1.35 * quantify
  38. elif product == 'peanuts':
  39. price = 1.55 * quantify
  40. print("{0:.2f}".format(price))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement