KeyError Traceback (most recent call last)
Cell In[1], line 26
21 # 计算单位和个人缴费总额
22 total_company_payment = sum([
23 base_salary_min * rate[“company”] for rate in insurance_rates.values()
24 ])
—> 26 total_personal_payment = sum([
27 base_salary_min * rate[“personal”] for rate in insurance_rates.values()
28 ])
30 total_payment = total_company_payment + total_personal_payment
32 total_payment
Cell In[1], line 27, in <listcomp>(.0)
21 # 计算单位和个人缴费总额
22 total_company_payment = sum([
23 base_salary_min * rate[“company”] for rate in insurance_rates.values()
24 ])
26 total_personal_payment = sum([
—> 27 base_salary_min * rate[“personal”] for rate in insurance_rates.values()
28 ])
30 total_payment = total_company_payment + total_personal_payment
32 total_payment
KeyError: ‘personal’