TypeError Traceback (most recent call last)
Cell In[1], line 14
5 proportion = {
6 “养老保险”: 0.08, # 个人缴费比例
7 “医疗保险”: 0.02, # 个人缴费比例
(…)
10 “生育保险”: 0.005 # 个人缴费比例
11 }
13 # 计算个人每月扣款金额
—> 14 monthly_deduction = sum([base_salary * rate for base_salary, rate in proportion.items()])
15 monthly_deduction
Cell In[1], line 14, in <listcomp>(.0)
5 proportion = {
6 “养老保险”: 0.08, # 个人缴费比例
7 “医疗保险”: 0.02, # 个人缴费比例
(…)
10 “生育保险”: 0.005 # 个人缴费比例
11 }
13 # 计算个人每月扣款金额
—> 14 monthly_deduction = sum([base_salary * rate for base_salary, rate in proportion.items()])
15 monthly_deduction
TypeError: can’t multiply sequence by non-int of type ‘float’