I haven’t posted in the forum before so I’m not sure if I’m posting the correct thread (also sorry for necroing). In regards to the zip() function. It is stated that it merges multiple lists into a list of lists, except that [(a,b),(a,b)] is a list of tuples. Is there a way to actually create a list of lists [[a,b],[a,b],[a,b]]?
names = ['Jenny', 'Alexus', 'Sam', 'Grace'] dogs_names = ['Elphonse', 'Dr. Doggy DDS', 'Carter', 'Ralph'] names_and_dogs_names = zip(names, dogs_names) list_of_names_and_dogs_names = list(names_and_dogs_names) print(type(list_of_names_and_dogs_names))
Output would be: <class ‘tuple’>