Write a list comprehension for printing rows into columns and vv


Topic: Write a list comprehension for printing rows into columns and vv

Solution

l=[[1 ,2, 3], [4, 5, 6], [7, 8, 9]]
print([[row[i] for row in l] for i in range(3)])



List all Python Programs