desislava_topuzakova

12. Trade Commissions

Oct 21st, 2020
680
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # 1. read input -> city, count,
  2. # 2. percent -> Печалба => percent * count
  3.  
  4. city = input()
  5. sales = float(input())
  6.  
  7. if city == 'Sofia':
  8.     if 0 <= sales <= 500:
  9.         # 5% -> 0.05
  10.         # % -> число   (% / 100)
  11.         print(f'{0.05 * sales:.2f}')
  12.     elif 500 < sales <= 1000:
  13.         print(f'{0.07 * sales:.2f}')
  14.     elif 1000 < sales <= 10000:
  15.         print(f'{0.08 * sales:.2f}')
  16.     elif sales > 10000:
  17.         print(f'{0.12 * sales:.2f}')
  18.     else:
  19.         print('error')
  20. elif city == 'Varna':
  21.     if 0 <= sales <= 500:
  22.         print(f'{0.045 * sales:.2f}')
  23.     elif 500 < sales <= 1000:
  24.         print(f'{0.075 * sales:.2f}')
  25.     elif 1000 < sales <= 10000:
  26.         print(f'{0.10 * sales:.2f}')
  27.     elif sales > 10000:
  28.         print(f'{0.13 * sales:.2f}')
  29.     else:
  30.         print('error')
  31. elif city == 'Plovdiv':
  32.     if 0 <= sales <= 500:
  33.         print(f'{0.055 * sales:.2f}')
  34.     elif 500 < sales <= 1000:
  35.         print(f'{0.08 * sales:.2f}')
  36.     elif 1000 < sales <= 10000:
  37.         print(f'{0.12 * sales:.2f}')
  38.     elif sales > 10000:
  39.         print(f'{0.145 * sales:.2f}')
  40.     else:
  41.         print('error')
  42. else:
  43.     print('error')
RAW Paste Data