1 # -*- coding: utf-8 -*- 2 3 total = int(input("税前总计:")) 4 5 #公积金10% 6 Gongjijin = total * 0.1 7 print("公积金个人缴纳:%.2f" %Gongjijin) 8 #养老保险8%,医保2%,失业0.4%,合计10.4% 9 Shebao = total * 0.104 10 yingnashui = total - Gongjijin - Shebao 11 12 print("扣除五险一金还剩:%.2f" %yingnashui ) 13 14 #应纳税所得额=应税收入-个人扣缴社保-个人扣缴公积金-个税起征点 15 yingnashui = float (yingnashui) - 3500 16 17 def shui(x): #阶梯纳税表 18 if x < 1500: 19 return x * 0.03 20 elif x <= 0: 21 return 'Error' 22 elif (x>1500 and x<=4500): 23 return (x*0.10 - 105) 24 elif x>4500 and x<=9000: 25 return (x*0.20 - 555) 26 elif x>9000 and x<=35000: 27 return (x*0.25 - 1005) 28 elif x>3500 and x<=55000: 29 return (x*0.3 - 2755) 30 elif x>55000 and x<=80000: 31 return(x*0.35 - 5505) 32 elif x>80000: 33 return (x*0.45 - 13505) 34 35 tax = shui(yingnashui) 36 37 38 print("税额共计:%.2f" %tax) 39 40 result = yingnashui - shui(yingnashui) +3500 41 42 print ("税后剩余:%.2f" %result) 43 44 input ("按任意键退出")