[Tutor] Program matx.py

Ethan Rosenberg ethanrosenberg414 at gmail.com
Sun Dec 24 15:41:13 EST 2023


Help Desk -

Thank you for the excellent help you give to Python programmers.

Do I have to be registered to submit a question?

This program is supposed to insert i*j into the cells of a 2x2 matrix.  I
receive a syntax error.

#matx.py
#program to add i*j to cells of 2x2 matrix

mat = [][]

for i in range(0,1):
    for j in range(0,1):
        mat[i][j] = i*j
print(mat)

Thank you in advance.


More information about the Tutor mailing list