On 23/01/13 03:08, Mitya Sirenef wrote:
To make the change you need, use list comprehension to make sums of all rows, sort it (using list sort method); iterate over it using enumerate() and print out "employee N, sum of hours:"
One problem with that approach is that the employees are identified by their index in the original row so you probably need to maintain a note of that index. So before sorting you might want to create a tuple with the id and the values then sort on the second element. Only slightly more complex...
hth. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor