On 01/23/2013 06:13 PM, Alan Gauld wrote:
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.
>

Oh, that's right - thanks for catching this.  -m



--
Lark's Tongue Guide to Python: http://lightbird.net/larks/

The best author will be the one who is ashamed to become a writer.
Friedrich Nietzsche

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to