TypeError Traceback (most recent call last)
Cell In[1], line 30
27 taxable_income = social_insurance_base - total_personal_social_insurance
29 # 确定税率区间
—> 30 tax_rate = next(rate for income_range, rate in tax_rates.items() if taxable_income <= income_range.split(‘-’)[1])
32 # 计算个人所得税
33 tax = taxable_income * tax_rate
Cell In[1], line 30, in <genexpr>(.0)
27 taxable_income = social_insurance_base - total_personal_social_insurance
29 # 确定税率区间
—> 30 tax_rate = next(rate for income_range, rate in tax_rates.items() if taxable_income <= income_range.split(‘-’)[1])
32 # 计算个人所得税
33 tax = taxable_income * tax_rate
TypeError: ‘<=’ not supported between instances of ‘float’ and ‘str’