TypeError Traceback (most recent call last)
Cell In[1], line 43
32 tax_rates = {
33 ‘0’: 0.03,
34 ‘3000’: 0.10,
(…)
39 ‘80000’: 0.45
40 }
42 # 计算个税
—> 43 tax = sum([
44 min(taxable_income, limit) * rate for limit, rate in tax_rates.items()
45 ])
47 # 计算税后工资
48 after_tax_salary = pre_tax_salary - tax
Cell In[1], line 44, in <listcomp>(.0)
32 tax_rates = {
33 ‘0’: 0.03,
34 ‘3000’: 0.10,
(…)
39 ‘80000’: 0.45
40 }
42 # 计算个税
43 tax = sum([
—> 44 min(taxable_income, limit) * rate for limit, rate in tax_rates.items()
45 ])
47 # 计算税后工资
48 after_tax_salary = pre_tax_salary - tax
TypeError: ‘<’ not supported between instances of ‘str’ and ‘float’