Keeping the structure of a list in after operating a nested loop
Suppose I have two lists as follow: x = [[‘a’,’b’,’c’],[‘e’,’f’]] y = [‘w’,’x’,’y’] I want to add each element of list x with each element of list y while keeping the structure as given in x the desired output should be like: [[‘aw’,’ax’,’ay’,’bw’,’bx’,’by’,’cw’,’cx’,’cy’],[‘ew’,’ex’,’ey’,’fw’,’fx’,’fy’]] So far I’ve done: res = [] for i in range(len(x)): for… Read More Keeping the structure of a list in after operating a nested loop