TypeError Traceback (most recent call last)
Cell In[1], line 12
2 social_insurance_rates = {
3 “养老保险”: 0.08,
4 “医疗保险”: 0.02,
(…)
8 “公积金”: 0.12
9 }
11 # 计算个人社保和公积金缴费总额
—> 12 total_social_insurance = sum(salary * rate for rate, salary in social_insurance_rates.items())
14 # 假设的工资水平
15 salary = 13500
Cell In[1], line 12, in <genexpr>(.0)
2 social_insurance_rates = {
3 “养老保险”: 0.08,
4 “医疗保险”: 0.02,
(…)
8 “公积金”: 0.12
9 }
11 # 计算个人社保和公积金缴费总额
—> 12 total_social_insurance = sum(salary * rate for rate, salary in social_insurance_rates.items())
14 # 假设的工资水平
15 salary = 13500
TypeError: can’t multiply sequence by non-int of type ‘float’