TypeError Traceback (most recent call last)
Cell In[1], line 12
3 social_security_rates = {
4 ‘养老保险’: 0.16, # 公司缴费比例
5 ‘失业保险’: 0.005, # 公司缴费比例
(…)
8 ‘生育保险’: 0.005, # 公司缴费比例
9 }
11 # 计算公司总承担金额
—> 12 total_company_contribution = sum(base_salary * rate for base_salary, rate in social_security_rates.items())
13 total_company_contribution
Cell In[1], line 12, in <genexpr>(.0)
3 social_security_rates = {
4 ‘养老保险’: 0.16, # 公司缴费比例
5 ‘失业保险’: 0.005, # 公司缴费比例
(…)
8 ‘生育保险’: 0.005, # 公司缴费比例
9 }
11 # 计算公司总承担金额
—> 12 total_company_contribution = sum(base_salary * rate for base_salary, rate in social_security_rates.items())
13 total_company_contribution
TypeError: can’t multiply sequence by non-int of type ‘float’