O'Reilly logo
  • Longxiang Lyu thinks this is interesting:

6-7. People:

From

Cover of Python Crash Course

Note

people = [{'last': 'trump', 'first': 'donald', 'city': 'washinton'},
{'last': 'bush', 'first': 'jeb', 'city': 'houston'},
{'last': 'west', 'first': 'kanye', 'city': 'LA'}]

for person in people:
name = person['first'].title() + " " + person['last'].title()
print("name: " + name)
print("location: " + person['city'])