I have the following data:
data = [['AB', 'BS, BT'], ['AH', 'AH'], ['AS', 'AS, GS']]
I would like to iterate through the lists of list to produce a list of tuples.
new_data = [('AB', 'BS'), ('AB', 'BT'), ('AH', 'AH'), ('AS', 'AS') ('AS', 'GS')]
I was thinking about using the zip() function, but wasn’t sure if I was using the right logic.
zipwouldn’t be my first choice. My first choice would beitertools.productanditertools.chainHope this helps