Re: matx3.py
dn via Tutor <[email protected]>
| Newsgroups | gmane.comp.python.tutor |
|---|---|
| Organization | DWM |
| Message-ID | <[email protected]> |
On 28/12/23 11:34, Ethan Rosenberg wrote: > 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. Please copy-paste the full set of error-messages rather than your summary/interpretation. mat is indeed first defined as a tuple. What did you intend it to be? -- Regards, =dn _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor