The code
ralph = {'type': 'cat','owner': 'mark'}
lucy = {'type': 'cat','owner': 'carrie'}
pets = [ralph, lucy]
for pet in pets:
print(str(pet))
owner = pet['owner']
print('pet type: ' + pet['type'] + '\n' + 'owner: ' + owner.title())
provides the output:
{'type': 'cat', 'owner': 'mark'}
pet type: cat
owner: Mark
{'type': 'cat', 'owner': 'carrie'}
pet type: cat
owner: Carrie
I was trying to print the name of each pet (Ralph and Lucy)