TypeError Traceback (most recent call last)
Cell In[1], line 13
4 personal_rates = {
5 ‘养老保险’: 0.08,
6 ‘医疗保险’: 0.02, # 假设
(…)
9 ‘生育保险’: 0 # 个人不缴费
10 }
12 # 计算个人扣款总额
—> 13 total_deduction = sum([base_salary * rate for rate, rate_name in personal_rates.items() if rate_name != ‘工伤保险’])
14 total_deduction
TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’