TypeError Traceback (most recent call last)
Cell In[1], line 17
14 tax_brackets = [(0, 3000, 0.03), (3000, 12000, 0.10), (12000, 25000, 0.20), (25000, 35000, 0.25), (35000, 55000, 0.30), (55000, float(‘inf’), 0.45)]
16 # 计算社保缴费
—> 17 social_security_payment = sum([base_salary * rate for base_salary, rate in social_security_rates.items()])
19 # 计算个税
20 income_after_social_security = 14900 - social_security_payment
Cell In[1], line 17, in <listcomp>(.0)
14 tax_brackets = [(0, 3000, 0.03), (3000, 12000, 0.10), (12000, 25000, 0.20), (25000, 35000, 0.25), (35000, 55000, 0.30), (55000, float(‘inf’), 0.45)]
16 # 计算社保缴费
—> 17 social_security_payment = sum([base_salary * rate for base_salary, rate in social_security_rates.items()])
19 # 计算个税
20 income_after_social_security = 14900 - social_security_payment
TypeError: can’t multiply sequence by non-int of type ‘float’