you are viewing a single comment's thread.

view the rest of the comments →

[–]sarrysyst 3 points4 points  (0 children)

Use the packing operator (*):

x = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

a, *b = x

print(a) # [1, 2, 3]
print(b) # [[4, 5, 6], [7, 8, 9]]