शंतनू wrote:
> s = [sum(x) for x in matrix]
> for q in sorted([(x,y) for x,y in enumerate(s)],
> key=operator.itemgetter(1)):
> print("Employee %d has worked %d hours" % (q[0], q[1]))
A minor simplification:
s = (sum(x) for x in matrix)
for q in sorted(enumerate(s), key=operator.itemgetter(1)):
print("Employee %d has worked %d hours" % q)
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor