Answer to Question #183255 in Python for Angelie Suarez

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


1
Expert's answer
2021-04-21T18:21:30-0400


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?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS