On 12/8/2013 2:06 PM, rafaella...@gmail.com wrote:
Even when you do get what lambda means and how use it,
name = lambda args: expression
which is a carryover from other languages, is inferior to
def name(args): return expression
because the function object resulting from lambda does not have a proper
name attribute.
def people(age):
people=[name for name in dic if dic[name]==age]
An alternative is
[name for name, value in dic.itervalues() if value == age]
In Python 3, remove 'iter'. It this is not homework and you are not
otherwise forced to start with Python 3, I (and some others here)
recommend starting with Python 3.
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list