#python
pets=[] #created an empty list
d={'owner_name': 'holland',
'pet_kind':'mischieveous',
}
d={'owner_name': 'rowman',
'pet_kind':'smart',
}
d={'owner_name': 'clark',
'pet_kind':'happy'
}
d={'owner_name': 'shaun',
'pet_kind':'shy',
}
d={'owner_name': 'seaman',
'pet_kind':'intellectual',
}
pets=[pets.append(pet) for pet in d.items()]
print(pets)
output is showing [None, None] , I believe it should show the dictionary #appended in pets but it is not please help a newbie here .. please
for pet in d.items():
pets.append(pet)
print(pets)
also if i use the for loop the second way it still gives me only the last dictionary as answer, the seaman and intellectual one, i am hopeful to learn this lang please help here i have included the second way above please check