0
I’m making a program where a user will add stories, he will add the theme, the title and the body of the story, and I put all this into dictionaries and added them into a list.
historias = [{'tema':'Princesas', 'titulo':'A princesa', 'A princesa':'TextoAPrincesa'},
{'tema':'Super Herois', 'titulo':'Iron Man 2', 'Iron Man 2':'TextoIronMan'},
{'tema':'Princesas', 'titulo':'A princesinha', 'A princesinha':'TextoAprincesinha'}]
So my problem is this, I would like to identify when the theme has equal values, as for example in the dictionary that there are two themes with the same value "Princesses"then I thought of a solution to add the names of the themes in a list and find out if some value repeats itself.
lista = []
for i in range(len(historias)):
lista.append(historias[i]['tema'])
print(lista)`
But I’m not able to identify if there are repeated values in this list, I searched and just found solutions to discover repeated integers and not strings. Could someone help?
Related? https://answall.com/questions/216413/identificar-elements-repeaters-em-lista-com-python?rq=1
– Wallace Maxters