desislava_topuzakova

05. Small Shop

Apr 17th, 2021
684
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # продукт -> text
  2. # град -> text
  3. # количество -> float
  4. # ед.цена -> зависи от продукт и град
  5. # крайна цена = количество * ед. цена
  6. product = input()
  7. town = input()
  8. quantity = float(input())
  9.  
  10. price_per_product = 0 # ед.цена
  11.  
  12. if town == "Sofia":
  13.     # проверка кой е продуктът
  14.     if product == "coffee":
  15.         price_per_product = 0.50
  16.     elif product == "water":
  17.         price_per_product = 0.80
  18.     elif product == "beer":
  19.         price_per_product = 1.20
  20.     elif product == "sweets":
  21.         price_per_product = 1.45
  22.     elif product == "peanuts":
  23.         price_per_product = 1.60
  24. elif town == "Plovdiv":
  25.     # проверка кой е продуктът
  26.     if product == "coffee":
  27.         price_per_product = 0.40
  28.     elif product == "water":
  29.         price_per_product = 0.70
  30.     elif product == "beer":
  31.         price_per_product = 1.15
  32.     elif product == "sweets":
  33.         price_per_product = 1.30
  34.     elif product == "peanuts":
  35.         price_per_product = 1.50
  36. elif town == "Varna":
  37.     # проверка кой е продуктът
  38.     if product == "coffee":
  39.         price_per_product = 0.45
  40.     elif product == "water":
  41.         price_per_product = 0.70
  42.     elif product == "beer":
  43.         price_per_product = 1.10
  44.     elif product == "sweets":
  45.         price_per_product = 1.35
  46.     elif product == "peanuts":
  47.         price_per_product = 1.55
  48.  
  49.  
  50. # знаем единичната цена за продукта
  51. final_price = quantity * price_per_product
  52. print(final_price)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×