[Tutor] Improving My Simple Game Code for Speed, Memory and Learning

Alan Gauld alan.gauld at btinternet.com
Sun Jan 4 00:52:29 CET 2015


On 03/01/15 23:10, WolfRage wrote:
> On 01/03/2015 04:42 PM, Dave Angel wrote:
>> self.transposed_grid = list( zip(*self.grid) )
> This results in the same thing with or with out the list() wrapper.

Are you sure?

Try inserting

print(self.transposed_grid)

immediately after the assignment and see if you get the
same output with and without list().

It may be that for practical purposes in your code it
makes no difference, but there should be a difference
in return value.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list