TypeError Traceback (most recent call last)
Cell In[1], line 11
2 insurance_types = {
3 “养老保险”: 0.08, # 个人缴费比例
4 “医疗保险”: 0.02, # 个人缴费比例
(…)
7 “生育保险”: 0.0 # 个人缴费比例为0,由单位缴纳
8 }
10 # 计算个人缴费总额
—> 11 total_personal_payment = sum([base_salary * rate for base_salary, rate in insurance_types.items()])
13 # 输出结果
14 total_personal_payment
Cell In[1], line 11, in <listcomp>(.0)
2 insurance_types = {
3 “养老保险”: 0.08, # 个人缴费比例
4 “医疗保险”: 0.02, # 个人缴费比例
(…)
7 “生育保险”: 0.0 # 个人缴费比例为0,由单位缴纳
8 }
10 # 计算个人缴费总额
—> 11 total_personal_payment = sum([base_salary * rate for base_salary, rate in insurance_types.items()])
13 # 输出结果
14 total_personal_payment
TypeError: can’t multiply sequence by non-int of type ‘float’