新个税计算器(Python):一个极其简单,也没有做任何排错处理的初学脚本,发上来只是为了大家可以增加自己的代码丰富它。
点这里下载:NewTax.zip
1 # -*- coding: cp936 -*-
2 #This script is using in MIC only,Powered by rexchenhan
3 #养老保险公司比例
4 EI_CoRate=0.323
5 #养老保险个人比例
6 EI_EmpRate=0.11
7 #公积金公司比例
8 HF_CoRate=0.1
9 #公积金个人比例
10 HF_EmpRate=0.1
11 #个税起征点
12 Threshold=3500
13
14 Emp_Salary=input (\'请输入你的税前薪水:\')
15 #Start to calculate
16 EI_Emp=Emp_Salary*EI_EmpRate+10
17 EI_Co=Emp_Salary*EI_CoRate
18 HF_Emp=Emp_Salary*HF_EmpRate
19 HF_Co=Emp_Salary*HF_CoRate
20 Emp_Sal_Before_Tax=Emp_Salary-(HF_Emp+EI_Emp)
21 Sal_NeedTax=Emp_Sal_Before_Tax-Threshold
22 Tax=0.0
23 Final_Cash=0.0
24 #calculate TAX
25 if Sal_NeedTax<=0:
26 Tax=0.0
27 elif Sal_NeedTax<1500:
28 Tax=Sal_NeedTax*0.03
29 elif Sal_NeedTax<4500:
30 Tax=Sal_NeedTax*0.1
31 elif Sal_NeedTax<9000:
32 Tax=Sal_NeedTax*0.2
33 elif Sal_NeedTax<35000:
34 Tax=Sal_NeedTax*0.25
35 elif Sal_NeedTax<55000:
36 Tax=Sal_NeedTax*0.3
37 elif Sal_NeedTax<80000:
38 Tax=Sal_NeedTax*0.35
39 else:Tax=Sal_NeedTax*0.45
40
41 Final_Cash=Emp_Sal_Before_Tax-Tax
42 #Start to print the result
43 Str1=\'住房公积金缴纳:个人承担:%6.1f 公司承担:%6.1f\' % (HF_Emp,HF_Co)
44 Str2=\'养老保险金缴纳:个人承担:%6.1f 公司承担:%6.1f\' % (EI_Emp,EI_Co)
45 Str3=\'扣除各类保险后,需缴税部分:%6.1f\' % Emp_Sal_Before_Tax
46 Str4=\'您需要缴税:%6.1f\' % Tax
47 Str5=\'您的最终收入:%6.1f\' % Final_Cash
48 print \'*\'*60
49 print Str1
50 print Str2
51 print Str3
52 print Str4
53 print Str5
2 #This script is using in MIC only,Powered by rexchenhan
3 #养老保险公司比例
4 EI_CoRate=0.323
5 #养老保险个人比例
6 EI_EmpRate=0.11
7 #公积金公司比例
8 HF_CoRate=0.1
9 #公积金个人比例
10 HF_EmpRate=0.1
11 #个税起征点
12 Threshold=3500
13
14 Emp_Salary=input (\'请输入你的税前薪水:\')
15 #Start to calculate
16 EI_Emp=Emp_Salary*EI_EmpRate+10
17 EI_Co=Emp_Salary*EI_CoRate
18 HF_Emp=Emp_Salary*HF_EmpRate
19 HF_Co=Emp_Salary*HF_CoRate
20 Emp_Sal_Before_Tax=Emp_Salary-(HF_Emp+EI_Emp)
21 Sal_NeedTax=Emp_Sal_Before_Tax-Threshold
22 Tax=0.0
23 Final_Cash=0.0
24 #calculate TAX
25 if Sal_NeedTax<=0:
26 Tax=0.0
27 elif Sal_NeedTax<1500:
28 Tax=Sal_NeedTax*0.03
29 elif Sal_NeedTax<4500:
30 Tax=Sal_NeedTax*0.1
31 elif Sal_NeedTax<9000:
32 Tax=Sal_NeedTax*0.2
33 elif Sal_NeedTax<35000:
34 Tax=Sal_NeedTax*0.25
35 elif Sal_NeedTax<55000:
36 Tax=Sal_NeedTax*0.3
37 elif Sal_NeedTax<80000:
38 Tax=Sal_NeedTax*0.35
39 else:Tax=Sal_NeedTax*0.45
40
41 Final_Cash=Emp_Sal_Before_Tax-Tax
42 #Start to print the result
43 Str1=\'住房公积金缴纳:个人承担:%6.1f 公司承担:%6.1f\' % (HF_Emp,HF_Co)
44 Str2=\'养老保险金缴纳:个人承担:%6.1f 公司承担:%6.1f\' % (EI_Emp,EI_Co)
45 Str3=\'扣除各类保险后,需缴税部分:%6.1f\' % Emp_Sal_Before_Tax
46 Str4=\'您需要缴税:%6.1f\' % Tax
47 Str5=\'您的最终收入:%6.1f\' % Final_Cash
48 print \'*\'*60
49 print Str1
50 print Str2
51 print Str3
52 print Str4
53 print Str5