|
Sebastian uses the following in his code. I don't understand the len(p[i]) and Python doesn't seem to either as you can see from the 'Typeerror' it gives below. len(p) makes sense but what is len(p[i])? Seems like it would always be zero. (Sorry if it's a dumb question. I'm struggling to learn Python along with this class :)
0 Traceback (most recent call last): |
|
p is an array of rows. len(p) is the number of rows in the row p. p[1] is an array of elements (columns) in the row. len(p[1]) is the number of columns in the matrix p. |
|
Since p is a list of lists, len(p[i]) is the length of row i. Since you're defining p as a simple list it won't work. Try it for |