python条件语句个税计算器
时间: 2023-11-03 14:03:17 浏览: 110
python个税计算
请根据提供的引用内容,使用下面的代码对应用中的个税计算器进行补充。在计算个税之前,需要根据个税起征点和五险一金等因素计算出应发工资。然后,根据税率表计算出应缴纳的个税额度。
```python
salary = float(input()) # 应发工资薪金所得
five_one_insurance_fund = float(input()) # 五险一金
exemption = float(input()) # 个税免征额
# 计算个税起征点
threshold = 5000
# 计算应纳税所得额
taxable_income = salary - five_one_insurance_fund - exemption - threshold
# 计算应缴纳税款
tax = 0
if taxable_income <= 0:
tax = 0
elif taxable_income <= 3000:
tax = taxable_income * 0.03
elif taxable_income <= 12000:
tax = taxable_income * 0.1 - 210
elif taxable_income <= 25000:
tax = taxable_income * 0.2 - 1410
elif taxable_income <= 35000:
tax = taxable_income * 0.25 - 2660
elif taxable_income <= 55000:
tax = taxable_income * 0.3 - 4410
elif taxable_income <= 80000:
tax = taxable_income * 0.35 - 7160
else:
tax = taxable_income * 0.45 - 15160
# 输出应缴纳税款
print("应缴纳税款:", tax)
```
阅读全文