[Python] Printing 2 dimension list by row and column [duplicate]

Discussão em 'Python' iniciado por Stack, Abril 14, 2025.

  1. Stack

    Stack Membro Participativo

    Print the 2-dimensional list mult_table by row and column. Using nested loops. Sample output for the given program(without spacing between each row):

    1 | 2 | 3

    2 | 4 | 6

    3 | 6 | 9

    This is my code: I tried using a nested loop but I have my output at the bottom. It has the extra | at the end

    for row in mult_table:
    for cell in row:
    print(cell,end=' | ' )
    print()


    1 | 2 | 3 |

    2 | 4 | 6 |

    3 | 6 | 9 |

    Continue reading...

Compartilhe esta Página