Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- size = input()
- color = input()
- volume = int(input())
- egg_price = 0
- if color == "Red":
- if size == "Large":
- egg_price += 16
- elif size == "Medium":
- egg_price += 13
- elif size == "Small":
- egg_price += 9
- elif color == "Green":
- if size == "Large":
- egg_price += 12
- elif size == "Medium":
- egg_price += 9
- elif size == "Small":
- egg_price += 8
- elif color == "Yellow":
- if size == "Large":
- egg_price += 9
- elif size == "Medium":
- egg_price += 7
- elif size == "Small":
- egg_price += 5
- print(f"{egg_price * volume * 0.65:.2f} leva.")
- Решение с колекция:
- size = input()
- color = input()
- volume = int(input())
- egg_price = {"Red": {"Large": 16, "Medium": 13, "Small": 9},
- "Green": {"Large": 12, "Medium": 9, "Small": 8},
- "Yellow": {"Large": 9, "Medium": 7, "Small": 5}}
- total_sum = egg_price[color][size] * volume * 0.65
- print(f"{total_sum:.2f} leva.")
- Тарикатско решение:)
- print(f'{({"Large": {"Red": 16, "Green": 12, "Yellow": 9}, "Medium": {"Red": 13, "Green": 9, "Yellow": 8}, "Small": {"Red": 9, "Green": 8, "Yellow": 5}}[input()][input()] * int(input()) * 0.65):.2f} leva.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement