I have a list say:
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
I want to unpack it into three lists such that:
list1 = [1, 2]
list2 = [3, 4, 5]
list3 = [6, 7, 8, 9, 10]
I can do it using slicing as:
list1 = my_list[0 : 2]
list2 = my_list[2 : 5]
list3 = my_list[5 : 10]
But I want to know if there exists a more elegant way to unpack original list into these 3 sub-lists directly.