TypeError Traceback (most recent call last)
Cell In[1], line 20
10 base_salary = 8300
11 company_contribution = {
12 “养老保险”: (0.16, 0.20),
13 “医疗保险”: 0.09,
(…)
17 “住房公积金”: (0.05, 0.12)
18 }
—> 20 total_company_contribution = sum([
21 base_salary * (company_contribution[insurance][0] + company_contribution[insurance][1]) / 2
22 for insurance in company_contribution
23 ])
25 total_company_contribution
Cell In[1], line 21, in <listcomp>(.0)
10 base_salary = 8300
11 company_contribution = {
12 “养老保险”: (0.16, 0.20),
13 “医疗保险”: 0.09,
(…)
17 “住房公积金”: (0.05, 0.12)
18 }
20 total_company_contribution = sum([
—> 21 base_salary * (company_contribution[insurance][0] + company_contribution[insurance][1]) / 2
22 for insurance in company_contribution
23 ])
25 total_company_contribution
TypeError: ‘float’ object is not subscriptable