编写程序输入个人当月税前收入,计算个人所得税及个人实际收入
时间: 2024-06-12 09:06:35 浏览: 89
税前收入为x元,则个人所得税分以下几档:
- 若x<=3000元,个人所得税为0元;
- 若3000元<x<=12000元,个人所得税为(x-3000)*0.03元;
- 若12000元<x<=25000元,个人所得税为(x-12000)*0.1+900元;
- 若25000元<x<=35000元,个人所得税为(x-25000)*0.2+2400元;
- 若35000元<x<=55000元,个人所得税为(x-35000)*0.25+4900元;
- 若55000元<x<=80000元,个人所得税为(x-55000)*0.3+9400元;
- 若x>80000元,个人所得税为(x-80000)*0.35+17400元。
个人实际收入为税前收入减去个人所得税。
以下是Python代码实现:
income = float(input("请输入个人税前收入:"))
if income <= 3000:
tax = 0
elif income <= 12000:
tax = (income - 3000) * 0.03
elif income <= 25000:
tax = (income - 12000) * 0.1 + 900
elif income <= 35000:
tax = (income - 25000) * 0.2 + 2400
elif income <= 55000:
tax = (income - 35000) * 0.25 + 4900
elif income <= 80000:
tax = (income - 55000) * 0.3 + 9400
else:
tax = (income - 80000) * 0.35 + 17400
real_income = income - tax
print("个人所得税为:{:.2f}元,个人实际收入为:{:.2f}元。".format(tax, real_income))
阅读全文