KeyError Traceback (most recent call last)
Cell In[1], line 36
14 social_insurance = {
15 “养老保险”: {
16 “个人”: base_salary * proportion[“养老保险”][“个人”],
(…)
32 }
33 }
35 # 计算总费用
—> 36 total_personal_payment = sum([social_insurance[i][“个人”] for i in social_insurance])
37 total_company_payment = sum([social_insurance[i][“单位”] for i in social_insurance])
39 total_payment = {
40 “个人缴费”: total_personal_payment,
41 “单位缴费”: total_company_payment,
42 “总计”: total_personal_payment + total_company_payment
43 }
Cell In[1], line 36, in <listcomp>(.0)
14 social_insurance = {
15 “养老保险”: {
16 “个人”: base_salary * proportion[“养老保险”][“个人”],
(…)
32 }
33 }
35 # 计算总费用
—> 36 total_personal_payment = sum([social_insurance[i][“个人”] for i in social_insurance])
37 total_company_payment = sum([social_insurance[i][“单位”] for i in social_insurance])
39 total_payment = {
40 “个人缴费”: total_personal_payment,
41 “单位缴费”: total_company_payment,
42 “总计”: total_personal_payment + total_company_payment
43 }
KeyError: ‘个人’