create a list of each element after an iteration of list comprehension

Understanding of list comprehension is needed here and it also depends on where you put the square brackets


yb1=[[j+1 for j in i] for i in y]



[[2, 2, 2], [3, 3, 3]]

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top