Advertisement
dkyoseff

Conditional Statements Advanced - Lab / 05. Small Shop

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