On 08/12/2013 18:14, rafaella...@gmail.com wrote:
On Sunday, December 8, 2013 6:07:47 PM UTC, YBM wrote:
Le 08.12.2013 18:59, rafaella...@gmail.com a �crit :

i have a dictionary with names and ages for each name.

I want to write a function that takes in an age and returns

the names of all the people who are that age.

please help



ageDict = { 'john':42, 'jane':36, 'paul':42 }

peopleWithAge = lambda age: [ name for name in ageDict if

                              ageDict[name]==age]


sorry but i'm new to python ;p
1. it has to be in a form of a function called people and
2. how this code takes in an age and returns the names?


I'm awfully sorry but I'm not doing your homework for you :)

--
My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to