ValueError Traceback (most recent call last)
Cell In[1], line 30
19 income_tax_rate = {
20 “0-3000”: 0.03,
21 “3000-12000”: 0.10,
(…)
26 “80000+”: 0.45,
27 }
29 # 确定适用税率
—> 30 tax_rate = next(rate for limit, rate in income_tax_rate.items() if taxable_income <= int(limit))
32 # 计算个税
33 income_tax = taxable_income * tax_rate
Cell In[1], line 30, in <genexpr>(.0)
19 income_tax_rate = {
20 “0-3000”: 0.03,
21 “3000-12000”: 0.10,
(…)
26 “80000+”: 0.45,
27 }
29 # 确定适用税率
—> 30 tax_rate = next(rate for limit, rate in income_tax_rate.items() if taxable_income <= int(limit))
32 # 计算个税
33 income_tax = taxable_income * tax_rate
ValueError: invalid literal for int() with base 10: ‘0-3000’