Advertisement
PowerCell46

Small shop Python

Dec 15th, 2022 (edited)
736
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.98 KB | None | 0 0
  1. import math
  2.  
  3. product = str(input())
  4. city = str(input())
  5. quantity = float(input())
  6. price = 0
  7.  
  8. if city == "Sofia":
  9.  
  10.     if product == "coffee":
  11.         price = 0.50
  12.     elif product == "water":
  13.         price = 0.80
  14.     elif product == "beer":
  15.         price = 1.20
  16.     elif product == "sweets":
  17.         price = 1.45
  18.     elif product == "peanuts":
  19.         price = 1.60
  20.  
  21. elif city == "Plovdiv":
  22.  
  23.     if product == "coffee":
  24.         price = 0.40
  25.     elif product == "water":
  26.         price = 0.70
  27.     elif product == "beer":
  28.         price = 1.15
  29.     elif product == "sweets":
  30.         price = 1.30
  31.     elif product == "peanuts":
  32.         price = 1.50
  33.  
  34. elif city == "Varna":
  35.  
  36.     if product == "coffee":
  37.         price = 0.45
  38.     elif product == "water":
  39.         price = 0.70
  40.     elif product == "beer":
  41.         price = 1.10
  42.     elif product == "sweets":
  43.         price = 1.35
  44.     elif product == "peanuts":
  45.         price = 1.55
  46.  
  47. sum = (quantity * price)
  48. print(sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement