2
Follows the code:
layla = {'tipo':'cachorro', 'nome_dono':'lucas'}
ratata = {'tipo':'rato', 'nome_dono': 'Dante'}
pikachu = {'tipo': 'furão', 'nome_dono':'Ash'}
pets = [layla, ratata, pikachu]
for animal in pets:
print ("Nome do dono:", animal["nome_dono"].title(),"\nEspécie do animal:", animal["tipo"].title(), "\n")
I also need to print the name of the animal, which in turn is the name of the dictionary.
How do I do that?
You need to have a key to the animal’s name, no?
– Felipe Avelar