Y
YBM
Le 08.12.2013 20:06, (e-mail address removed) a écrit :
No it doesn't. You are printing things not returning something.
and combine_list is the most stupidest function you could write
in Python, as it is built-in with the name 'zip'.
function'''
... return [name for name in dic if dic[name]==age]
...['Gary', 'Alice', 'Frank']
Sorry for having being rude, but :
1. you shouldn't post raw homework in any kind of public group
(aren't you supposed to learn something by yourself ?)
2. your teacher is a nut.
i get it, thanks a lot i wrote a different one and it works
def people(age):
people=[name for name in dic if dic[name]==age]
print(people)
No it doesn't. You are printing things not returning something.
and combine_list is the most stupidest function you could write
in Python, as it is built-in with the name 'zip'.
... ''' How stupid it is to write three line for a one-linename = ['Alice', 'Bob', 'Cathy', 'Dan', 'Ed', 'Frank', 'Gary', 'Helen', 'Irene', 'Jack', 'Kelly', 'Larry']
age = [20, 21, 18, 18, 19, 20, 20, 19, 19, 19, 22, 19]
dic = dict(zip(name,age))
def people(age):
function'''
... return [name for name in dic if dic[name]==age]
...['Gary', 'Alice', 'Frank']
Sorry for having being rude, but :
1. you shouldn't post raw homework in any kind of public group
(aren't you supposed to learn something by yourself ?)
2. your teacher is a nut.