题目应纳税所得额 工资金额 - 起征点(5000 元)纳税 应纳税所得额 × 税率 速算扣除数税率及速算扣除数对应表应纳税所得额税率速算扣除数元不超过 3000 元3%0超过 3000 元至 12000 元10%210超过 12000 元至 25000 元20%1410超过 25000 元至 35000 元25%2660超过 35000 元至 55000 元30%4410超过 55000 元至 80000 元35%7160超过 80000 元45%15160代码实现income int(input(请输入你的薪资)) salary 0 shouldPay 0 tax 0 def calculator(num): shouldPay num - 5000 if shouldPay 0: tax 0 elif 0 shouldPay 3000: tax shouldPay * 0.03 elif 3000 shouldPay 12000: tax shouldPay * 0.1-210 elif 12000 shouldPay 25000: tax shouldPay * 0.2-1410 elif 25000 shouldPay 35000: tax shouldPay * 0.25-2660 elif 35000 shouldPay 55000: tax shouldPay * 0.3-4410 elif 55000 shouldPay 80000: tax shouldPay * 0.35-7160 else: tax shouldPay * 0.45-15160 salary num - tax return salary print(你的税后收入是{:.2f}.format(calculator(income)))代码运行参考输出只保存两位小数参考这个链接:format函数中如何指定小数点后两位输出_编程语言-CSDN问答