Zip() with a list of lists and a second list

If I have a list of lists like this:

mash_staff = [[“Potter”, “Colonel”], [“Klinger”, “Corporal”], [“Houlihan”, “Major”], [“Hunnicutt”, “Captain”]]

and a second list

mash_forenames = [“Sherman”, “Maxwell”, “Margaret”, “BJ”]

Will zipping the two together give me three values per list?

You can try it? That is the easiest way to find out.

looping over mash_staff will give you one element (a list with two elements), so you will still need to unpack that

1 Like