Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1. read input -> product, city, quantity
- # 2. product и city -> ед. цена на продукта
- # 3. print крайна цена -> quantity * ед. цена на продукта
- product = input()
- city = input()
- quantity = float(input())
- price = 0 # ед. цена за продукта
- if city == 'Sofia':
- # products
- if product == 'coffee':
- price = 0.50
- elif product == 'water':
- price = 0.80
- elif product == 'beer':
- price = 1.20
- elif product == 'sweets':
- price = 1.45
- elif product == 'peanuts':
- price = 1.60
- elif city == 'Plovdiv':
- # products
- if product == 'coffee':
- price = 0.40
- elif product == 'water':
- price = 0.70
- elif product == 'beer':
- price = 1.15
- elif product == 'sweets':
- price = 1.30
- elif product == 'peanuts':
- price = 1.50
- elif city == 'Varna':
- # products
- if product == 'coffee':
- price = 0.45
- elif product == 'water':
- price = 0.70
- elif product == 'beer':
- price = 1.10
- elif product == 'sweets':
- price = 1.35
- elif product == 'peanuts':
- price = 1.55
- # знаем ед. цена за продукт спрямо града
- print(quantity * price)
Add Comment
Please, Sign In to add comment