python programming help

Gary Herron gary.herron at islandtraining.com
Sun Dec 8 19:20:37 CET 2013


On 12/08/2013 09:59 AM, rafaellasav at gmail.com wrote:
> 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

This looks like homework for a beginning programming class. Correct?

We like helping people use Python, and we like helping people learn 
Python, but neither of those purposes are served by us *doing* your 
homework for you.

Please, you try to solve the problem, and when you get stuck, show us 
your code, and ask a specific question.

Hint:  You will almost certainly need a loop (through the dictionary 
entries), an 'if' conditional to test for the age matching the given 
age, and a print,

Gary Herron



More information about the Python-list mailing list