码迷,mamicode.com
首页 > 编程语言 > 详细

python计算工资个税

时间:2018-04-02 15:10:30      阅读:318      评论:0      收藏:0      [点我收藏+]

标签:gpo   养老   col   result   pos   utf-8   oat   style   jin   

 

 

 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 ("按任意键退出")

 

python计算工资个税

标签:gpo   养老   col   result   pos   utf-8   oat   style   jin   

原文地址:https://www.cnblogs.com/BH8ANK/p/8693094.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!