On 11/21/2010 8:15 AM Josep M. Fontana said...

  return sorted(word_table.items(), key=lambda item: item[1], reverse=True)
<snip>
What I don't understand is the syntax of "item : item[1]".

Key defines a lambda function that accepts as a single passed parameter named item and returns the element in position [1] thereof.

HTH,

Emile

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

Reply via email to