fork(2) download
  1. # by Nurudeen
  2. def calculate_tax(dic):
  3. result = {}
  4. for name in dic.keys():
  5. if dic[name] > 50000:
  6. result[name]=0.3 * dic[name]
  7. elif dic[name] > 30750:
  8. result[name]=0.25 * dic[name]
  9. elif dic[name] > 20200:
  10. result[name]=0.2 * dic[name]
  11. elif dic[name] > 10000:
  12. result[name]=0.15 * dic[name]
  13. elif dic[name] > 1000:
  14. result[name]=0.1 * dic[name]
  15. else:
  16. result[name]=0 * dic[name]
  17. return result
  18.  
  19.  
  20. print calculate_tax({'d4guy':60500,'umu101':45000,'charley94':30000,'beejaykumar':8455,'bisola':19800,'oneluvs':90000,'folzye':11200,'lekibraky':650,'d34lw4p':1200000})
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
{'oneluvs': 27000.0, 'charley94': 6000.0, 'folzye': 1680.0, 'd34lw4p': 360000.0, 'd4guy': 18150.0, 'lekibraky': 0, 'beejaykumar': 845.5, 'bisola': 2970.0, 'umu101': 11250.0}