TypeError Traceback (most recent call last)
Cell In[1], line 15
11 base_salary = 6300
13 # 计算单位和个人缴费总额
14 total_payment = {
—> 15 “单位”: sum(payment_rates[ins][“单位”] * base_salary for ins in payment_rates if payment_rates[ins][“单位”] > 0),
16 “个人”: sum(payment_rates[ins][“个人”] * base_salary for ins in payment_rates if payment_rates[ins][“个人”] > 0)
17 }
19 total_payment
Cell In[1], line 15, in <genexpr>(.0)
11 base_salary = 6300
13 # 计算单位和个人缴费总额
14 total_payment = {
—> 15 “单位”: sum(payment_rates[ins][“单位”] * base_salary for ins in payment_rates if payment_rates[ins][“单位”] > 0),
16 “个人”: sum(payment_rates[ins][“个人”] * base_salary for ins in payment_rates if payment_rates[ins][“个人”] > 0)
17 }
19 total_payment
TypeError: ‘float’ object is not subscriptable