OK, I'm all in favor of more descriptive variable names. But the variable row here runs along columns and the variable col runs along rows. |
|
Or you could write even simpler (looks almost as pseudo-code now):
I like how nice and clean this looks. Since we don't need the indices themselves, why bother with all than range(len(...)) stuff? That goes for initializing to 0 too: newpath = [[0 for cell in row] for row in path] @yzzid yes, very true. It's so much more readable. There are cases when we need indices, but not in these initializations of lists |
|
Good catch! Fixed in the programming quiz itself. :) |
|
Yeah I thought about that too. Now I think of it like 'row' initializes a row and 'col' copies that row down to create the columns. |
|
These are all good suggestions, thanks |
Didn't we have this discussion a while back? Oh wait... they haven't fixed it yet. Might just be sticking to their usual format.
Yep, this mangled position of row and col have already been spotted a few days ago...