Question #183255

Create a program with nested list and displays this kind of output:


sample output:

[['Egg', 'Milk', 'Meat', ], ['Potato', 'Carrot', 'Turnip', ],['Apple', 'Orange', 'Grape', ]]

Milk

Turnip

Grape


Expert's answer


A = [['Egg', 'Milk', 'Meat'], ['Potato', 'Carrot', 'Turnip'],['Apple', 'Orange', 'Grape']]


print("Input List: ",A,"\n\n")
row = len(A)
col = len(A[0])
print("Output\n")
c=1
for r in range(0,row):
    print(A[r][c])
    if(c<col-1): c=c+1
LATEST TUTORIALS
APPROVED BY CLIENTS