On 01/03/2015 04:22 PM, WolfRage wrote:
On 01/03/2015 06:58 AM, Dave Angel wrote:
To transpose a grid, you want to use the zip() function.
self.transposed_grid = zip(*self.grid)
I see this gives me a list that is the column. Thus it solves the column
iteration problem, because now I can feed it to my checking and
elimination functions that take a slice.
Thanks!
Implementing now.
I suspect you want instead:
self.transposed_grid = list( zip(*self.grid) )
in Python 3.4. zip gives an iterable for python 3.x, while it gave a
list in python 2.x
This is what I meant by "untested."
--
DaveA
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor