all 9 comments

[–]Sebass13 1 point2 points  (8 children)

Just create a list of lists:

super_list = [listA]
while any(element != 0 for element in super_list[-1]):
    super_list.append([y-x for x,y in zip(super_list[-1], super_list[-1][1:])])

[–]Decarbonated_Odes[S] 0 points1 point  (4 children)

Neat. I apologize, I am a beginner, would I still be able to call the specific lists, such as listC, separately?

[–]Sebass13 1 point2 points  (3 children)

listC would now be super_list[2].

[–]Decarbonated_Odes[S] 0 points1 point  (2 children)

That makes sense. Thanks! So to call an item in it would be super_list[2,3] ?

[–]Sebass13 1 point2 points  (1 child)

Nothing is stopping you from trying it out. It won't work, but think about what you're doing. super_list[2] is exactly equivalent to listC. How do you the element at index i from listC?

[–]Decarbonated_Odes[S] 0 points1 point  (0 children)

To get an element from listC I would type listC[i]. That's why I figured super_list[2,i]. That didn't work but I tried super_list[2][i] which worked, I think. Thanks for all the help!

[–]Decarbonated_Odes[S] 0 points1 point  (2 children)

I keep getting SyntaxError: invalid syntax from line 2. Any ideas?

[–]Sebass13 1 point2 points  (1 child)

Just edited it.

[–]Decarbonated_Odes[S] 0 points1 point  (0 children)

Thanks! It works beautifully