NameError Traceback (most recent call last)
Cell In[1], line 11
2 social_security_rates = {
3 “养老保险”: 0.08, # 个人缴费比例
4 “医疗保险”: 0.02, # 个人缴费比例
(…)
7 “生育保险”: 0, # 个人不缴费
8 }
10 # 计算各项保险的个人缴费金额
—> 11 monthly_payments = {insurance: base_salary * rate for insurance, rate in social_security_rates.items()}
13 # 计算总缴费金额
14 total_monthly_payment = sum(monthly_payments.values())
Cell In[1], line 11, in <dictcomp>(.0)
2 social_security_rates = {
3 “养老保险”: 0.08, # 个人缴费比例
4 “医疗保险”: 0.02, # 个人缴费比例
(…)
7 “生育保险”: 0, # 个人不缴费
8 }
10 # 计算各项保险的个人缴费金额
—> 11 monthly_payments = {insurance: base_salary * rate for insurance, rate in social_security_rates.items()}
13 # 计算总缴费金额
14 total_monthly_payment = sum(monthly_payments.values())
NameError: name ‘base_salary’ is not defined