Only last record is printing in child table why?

Hi Guys,
This is my code only last record is printing in child table, May I know what mistake i have done in this code.

kindly reply!
Thanks in advance!

def onchange_autofill(self):
    if self.autofill:
        product_categories = frappe.get_all(
            'Item Group', fields=['parent_item_group', 'name'])
        annual_point_scheme_lines = []
        for i in product_categories:
            # print(i.parent_item_group)
            if i.parent_item_group:
        print(annual_point_scheme_lines, 'kkkkkkkkkkk')
        var = self.annual_point_scheme_line
        for line in var:
            for i in annual_point_scheme_lines:
                line.categ_id = i
                line.point_assigned = 1

kindly please reply me @lekhnath for this problem.

Kindly reply me @peterg

kindly please reply me for this problem because I’m new to erpnext

It would help if you could also post the output you’re getting and the output you expect to get.