Imagine my old list is:
old = [[card, towel, bus], [mouse, eraser, laptop], [pad, pen, bar]]
goal:
new = [[card, mouse, pad], [towel, eraser, pen], [bus, laptop, bar]]
Things I've tried:
new = dict(zip(old[i] for i in range(len(old))))
new = [old[i][0] for i in old] #trying just to get a list of first indices, and then go from there
I feel like this is a trivial problem, but I'm having trouble. Thanks in advance for pointing me in the right direction!
Also: Imagine I have another list:
list_names = ['list1', 'list2', 'list3']
I would like to set the elements of this list to each one of the new lists:
list1 = [card, mouse, pad]
and so on.
Any ideas?