In the previous post we discussed iterating through a list of lists for accessing values. But what about assigning values? Of course because of mutation the following code definitely works: but what about this one? It works also! And now, what about this one? No, that does not work! That’s an example of Python mutation… Continue reading Change a value in a list of lists
There are many ways to iterate through a list of lists in Python, this one is nice for some cases: but when there is no need for indexing the following will work perfectly:
I made a python reader and writer for the image representation CSUnplugged activity. You can even download it for Windows. What I learned (the hard way) is that i corresponds to y (vertical), and j corresponds to x (horizontal), e.g.