Python题目+个税计算器
时间: 2023-12-22 20:27:00 浏览: 106
根据提供的引用内容,可以给出以下回答:
以下是一个Python个税计算器的例子:
```python
salary = float(input("请输入您的税前工资:"))
if salary < 0:
print("error")
else:
insurance = salary * 0.08 + salary * 0.02 + salary * 0.005 + salary * 0.06 + salary * 0.005 + salary * 0.12
taxable_income = salary - insurance - 5000
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
after_tax_salary = salary - insurance - tax
print("您的应缴税款为:{:.2f}元,实发工资为:{:.2f}元".format(tax, after_tax_salary))
```
阅读全文