Advertisement
simeonshopov

Trade Comission

Sep 19th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.15 KB | None | 0 0
  1. town = input().lower()
  2. sells = float(input())
  3.  
  4. small = 0 <= sells <= 500
  5. normal = 500 < sells <= 1000
  6. big = 1000 < sells <= 10000
  7. ultra = sells > 10000
  8.  
  9. if small:
  10.     if town == "sofia":
  11.         print(f"{(sells * 0.05):.2f}")
  12.     elif town == "varna":
  13.         print(f"{(sells * 0.045):.2f}")
  14.     elif town == "plovdiv":
  15.         print(f"{(sells * 0.055):.2f}")
  16.     else:
  17.       print("error")
  18. elif normal:
  19.     if town == "sofia":
  20.         print(f"{(sells * 0.07):.2f}")
  21.     elif town == "varna":
  22.         print(f"{(sells * 0.075):.2f}")
  23.     elif town == "plovdiv":
  24.         print(f"{(sells * 0.08):.2f}")
  25.     else:
  26.       print("error")
  27. elif big:
  28.     if town == "sofia":
  29.         print(f"{(sells * 0.08):.2f}")
  30.     elif town == "varna":
  31.         print(f"{(sells * 0.1):.2f}")
  32.     elif town == "plovdiv":
  33.         print(f"{(sells * 0.12):.2f}")
  34.     else:
  35.       print("error")
  36. elif ultra:
  37.     if town == "sofia":
  38.         print(f"{(sells * 0.12):.2f}")
  39.     elif town == "varna":
  40.         print(f"{(sells * 0.13):.2f}")
  41.     elif town == "plovdiv":
  42.         print(f"{(sells * 0.145):.2f}")
  43.     else:
  44.       print("error")
  45. else:
  46.     print("error")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement