5
I need to scroll through a list that contains dictionaries and present the information of this one. But testing the attributes here .item()
and .value()
I couldn’t. Look:
#6.8 - Animais de Estimação:
Pets = [{'Zeus':{'Tipo':'Gato','Dona':'Luciene'},'Jake':{'Tipo':'Dogão',
'Dona':'Ide'},'Bob':{'Tipo':'Cachorro','Dono':'Dartinho'}
}]
for info in Pets.items: #Classe ITEMS só funciona P\ Dic e não Para Listas :/
print(Pets('Zeus')) ???
The limitation, in this case, is not being able to have two pets with the same name.
– Woss
Cool! Solved here, I used a Dictionary inside another. Thank you. How do I enjoy the answer ?? ^^
– Nameless Man
@Namelessman There is no "like" here. But you can accept the answer if you think it was helpful and solved your problem - see how to do it reading the FAQ. And when you have more than 15 points on the site, will also be able vote on posts that find useful. Remembering that here the votes are not like the likes of facebook or other social networks, they have a different meaning
– hkotsubo
@hkotsubo well placed
– Otávio Reis Perkles