AttributeError Traceback (most recent call last)
Cell In[1], line 14
11 base_salary = 12400
13 # 计算单位与个人缴费总额
—> 14 total_company_payment = sum(rate * base_salary for rate, details in social_insurance_rates.items() for key, rate in details.items() if key == ‘company’)
15 total_individual_payment = sum(rate * base_salary for rate, details in social_insurance_rates.items() for key, rate in details.items() if key == ‘individual’)
17 total_payment = total_company_payment + total_individual_payment
Cell In[1], line 14, in <genexpr>(.0)
11 base_salary = 12400
13 # 计算单位与个人缴费总额
—> 14 total_company_payment = sum(rate * base_salary for rate, details in social_insurance_rates.items() for key, rate in details.items() if key == ‘company’)
15 total_individual_payment = sum(rate * base_salary for rate, details in social_insurance_rates.items() for key, rate in details.items() if key == ‘individual’)
17 total_payment = total_company_payment + total_individual_payment
AttributeError: ‘float’ object has no attribute ‘items’