python应用-工资计算
""" 工资计算 Author:罗万财 Date:2017-6-8 """ salary=float(input('请输入工资:')) insurance=float(input('五险一金:')) diff=salary-insurance-3500 if diff<=0: tax=0 deduction=0 elif diff<=1500: tax=0.03 deduction=0 elif diff<=4500: tax=0.1 deduction=105 elif diff<=9000: tax=0.2 deduction=555 elif diff<=35000: tax=0.25 deduction=1005 elif diff<=55000: deduction=2755 tax=0.33 elif diff<=80000: tax=0.35 deduction=5505 else: tax=0.45 deduction=13505 personal=diff*tax-deduction print('个人所得税:¥%.2f'%(personal)) print('实际工资:¥%.2f'%(salary-insurance-personal)) 结果: 请输入工资:25888 五险一金:555 个人所得税:¥4453.25 实际工资:¥20879.75
千行代码,Bug何处藏。 纵使上线又怎样,朝令改,夕断肠。