TypeError Traceback (most recent call last)
Cell In[1], line 14
5 social_security_rates = {
6 ‘养老保险’: 0.08, # 个人缴纳比例
7 ‘医疗保险’: 0.02, # 个人缴纳比例
(…)
10 ‘生育保险’: 0 # 个人不缴纳
11 }
13 # 计算社保缴费总额
—> 14 total_social_security = sum(basis * rate for basis, rate in social_security_rates.items())
16 # 计算个税
17 # 假设没有专项附加扣除
18 monthly_income = 19500 - total_social_security
Cell In[1], line 14, in <genexpr>(.0)
5 social_security_rates = {
6 ‘养老保险’: 0.08, # 个人缴纳比例
7 ‘医疗保险’: 0.02, # 个人缴纳比例
(…)
10 ‘生育保险’: 0 # 个人不缴纳
11 }
13 # 计算社保缴费总额
—> 14 total_social_security = sum(basis * rate for basis, rate in social_security_rates.items())
16 # 计算个税
17 # 假设没有专项附加扣除
18 monthly_income = 19500 - total_social_security
TypeError: can’t multiply sequence by non-int of type ‘float’