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
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
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments