matx3.py

Ethan Rosenberg <[email protected]>
Newsgroups gmane.comp.python.tutor
Message-ID <CAFQ-1+f68L7vVY48YO7t8khOogwYYzYA2D1-7C+6Mgn-+eFueA@mail.gmail.com>
Tutor -

Thank you for the wonderful help you provide to Python programmers.

Here is the program

#matx3.py
#Put i*j in cells of 3x3 matrix

Row = 1
Column =1
mat = [[1],[2],[3]],[[4],[5],[6]],[[7],[8],[9]]
#print(mat)
for i in range(0,3):
    print(mat[i])
for i in range(0,2):
    for j in range(0,2):
        for k in range(0,8):
            mat[k] = i*j
#print(mat)
for i in range(0,3):
    print(mat[i])

I receive an error that  mat[k] = i*j is a tuple??

Thanks in advance for your help.

Ethan Rosenberg
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.