child = []
parent = [1, 3, 5, 7, 9]
index = 2
child.append(parent[:index])
When I have this code run, instead of returning me a child list of
child = [1, 3]
I get a child list of:
child = [[1, 3]]
Is there a single line method of copying a few objects of a list into another list without making it into a nested list?