Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- city = input()
- sales = float(input())
- result = 0
- if city == "Sofia":
- if sales >= 0 and sales <=500:
- result = sales * 0.05
- elif sales > 500 and sales <= 1000:
- result = sales * 0.07
- elif sales > 1000 and sales <= 10000:
- result = sales * 0.08
- elif sales > 10000:
- result = sales * 0.12
- elif city == "Varna":
- if sales >= 0 and sales <=500:
- result = sales * 0.045
- elif sales > 500 and sales <= 1000:
- result = sales * 0.075
- elif sales > 1000 and sales <= 10000:
- result = sales * 0.10
- elif sales > 10000:
- result = sales * 0.13
- elif city == "Plovdiv":
- if sales >= 0 and sales <=500:
- result = sales * 0.055
- elif sales > 500 and sales <= 1000:
- result = sales * 0.08
- elif sales > 1000 and sales <= 10000:
- result = sales * 0.12
- elif sales > 10000:
- result = sales * 0.145
- else:
- result = "error"
- if type(result) == str or sales < 0:
- print("error")
- else:
- print(f"{result:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement