I have this list of dictionaries:
cust = [
{"id": 1, "name": u"name 1", "bill_amount": 1000},
{"id": 2, "name": u"name 2", "bill_amount": 5000},
{"id": 3, "name": u"name 3", "bill_amount": 7600},
{"id": 4, "name": u"name 4", "bill_amount": 30}
]
And I want to get a list of just the names.
Trying this:
def getName(x): x["name"]
print map(getName, cust)
Returns this:
[None, None, None, None]
Why? Am I missing something obvious?