On 10/07/13 13:05, Dave Angel wrote:
mylist = [(row[0],0) for row in rows]I'll guess it's the list comprehension that confuses you. That line is roughly equivalent to: mylist = [] for row in rows: mylist.append( (row[0], row) )
Except the second element in the tuple to append should be zero.
So you end up with a list of tuples, each consisting of row[0] and
a zero Presumably this will be the starting score for each item. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
