TypeError Traceback (most recent call last)
Cell In[1], line 14
5 insurance_rates = {
6 “养老保险”: 0.20,
7 “医疗保险”: 0.08,
(…)
10 “生育保险”: 0.002
11 }
13 # 计算总扣款金额
—> 14 total_deduction = sum([base * rate for base, rate in insurance_rates.items()])
16 # 输出结果
17 total_deduction
Cell In[1], line 14, in <listcomp>(.0)
5 insurance_rates = {
6 “养老保险”: 0.20,
7 “医疗保险”: 0.08,
(…)
10 “生育保险”: 0.002
11 }
13 # 计算总扣款金额
—> 14 total_deduction = sum([base * rate for base, rate in insurance_rates.items()])
16 # 输出结果
17 total_deduction
TypeError: can’t multiply sequence by non-int of type ‘float’