Advertisement
Spocoman

12. Trade Commissions

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