Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- town = input().lower()
- sells = float(input())
- towns = ["sofia", "varna", "plovdiv"]
- com = [[0.05, 0.045, 0.055], [0.07, 0.075, 0.08], [0.08, 0.1, 0.12], [0.12, 0.13, 0.145]]
- small = 0 <= sells <= 500
- normal = 500 < sells <= 1000
- big = 1000 < sells <= 10000
- ultra = sells > 10000
- if small:
- if town == (towns[0]):
- print(f"{(sells * (com[0][0])):.2f}")
- elif town == (towns[1]):
- print(f"{(sells * (com[0][1])):.2f}")
- elif town == (towns[2]):
- print(f"{(sells * (com[0][2])):.2f}")
- else:
- print("error")
- elif normal:
- if town == (towns[0]):
- print(f"{(sells * (com[1][0])):.2f}")
- elif town == (towns[1]):
- print(f"{(sells * (com[1][1])):.2f}")
- elif town == (towns[2]):
- print(f"{(sells * (com[1][2])):.2f}")
- else:
- print("error")
- elif big:
- if town == (towns[0]):
- print(f"{(sells * (com[2][0])):.2f}")
- elif town == (towns[1]):
- print(f"{(sells * (com[2][1])):.2f}")
- elif town == (towns[2]):
- print(f"{(sells * (com[2][2])):.2f}")
- else:
- print("error")
- elif ultra:
- if town == (towns[0]):
- print(f"{(sells * (com[3][0])):.2f}")
- elif town == (towns[1]):
- print(f"{(sells * (com[3][1])):.2f}")
- elif town == (towns[2]):
- print(f"{(sells * (com[3][2])):.2f}")
- else:
- print("error")
- else:
- print("error")
Advertisement
Add Comment
Please, Sign In to add comment