Re: [Tutor] Using a list comp in place of a for loop

2009-10-04 Thread Rich Lovely
2009/10/3 afith13 : > Hi tutors, > > I've got a loop and a comprehension that do the same thing (as far as I can > tell): > > for i in range(N): >  someList.append.newObject(i) > > ...and... > > [someList.append.newObject(i) for i in range(N)] > > I'm tempted to write this as a list comp because i

Re: [Tutor] Using a list

2009-05-30 Thread David
David wrote: Alan Gauld wrote: "Doug Reid" wrote The tutorial I'm using is discussing list, tuples, and dictionaries. ... four attributes: Strength,Stamina, Wisdom, and Dexterity. The player should be able to spend points from the pool on any attribute and should also be able to take points f

Re: [Tutor] Using a list

2009-05-30 Thread David
Alan Gauld wrote: "Doug Reid" wrote The tutorial I'm using is discussing list, tuples, and dictionaries. ... four attributes: Strength,Stamina, Wisdom, and Dexterity. The player should be able to spend points from the pool on any attribute and should also be able to take points from an attribu

Re: [Tutor] Using a list

2009-05-30 Thread Alan Gauld
"Doug Reid" wrote The tutorial I'm using is discussing list, tuples, and dictionaries. ... four attributes: Strength,Stamina, Wisdom, and Dexterity. The player should be able to spend points from the pool on any attribute and should also be able to take points from an attribute and put them bac