Advertisement
ydpetkov

trade_commmissions

Jul 26th, 2022
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. city = input()
  2. sales = float(input())
  3. result = 0
  4.  
  5. if city == "Sofia":
  6. if sales >= 0 and sales <=500:
  7. result = sales * 0.05
  8. elif sales > 500 and sales <= 1000:
  9. result = sales * 0.07
  10. elif sales > 1000 and sales <= 10000:
  11. result = sales * 0.08
  12. elif sales > 10000:
  13. result = sales * 0.12
  14. elif city == "Varna":
  15. if sales >= 0 and sales <=500:
  16. result = sales * 0.045
  17. elif sales > 500 and sales <= 1000:
  18. result = sales * 0.075
  19. elif sales > 1000 and sales <= 10000:
  20. result = sales * 0.10
  21. elif sales > 10000:
  22. result = sales * 0.13
  23. elif city == "Plovdiv":
  24. if sales >= 0 and sales <=500:
  25. result = sales * 0.055
  26. elif sales > 500 and sales <= 1000:
  27. result = sales * 0.08
  28. elif sales > 1000 and sales <= 10000:
  29. result = sales * 0.12
  30. elif sales > 10000:
  31. result = sales * 0.145
  32. else:
  33. result = "error"
  34. if type(result) == str or sales < 0:
  35. print("error")
  36. else:
  37. print(f"{result:.2f}")
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement