Posts by Diogo • 21 points
1 post
-
-1
votes2
answers586
viewsQ: How to count repeated elements in a list of tuples?
listaAnimais=[('leao', 'Simba'), ('javali', 'Pumba'), ('leao', 'Scar'), ('hiena', 'Banzai'), ('leao', 'Mufasa')] #especie,nome dicEspecies={} for especies,nome in listaAnimais:…