In a certain list I want to find those items that are the same to count them.
Currently until this code arrives, try to create a counter for the items but I have not succeeded:.
def lista_nombres():
nombres = []
while True:
x = input("Ingresa un nombre o 0 para terminar: ")
if x == "0":
break
if x in nombres:
continue
nombres.append(x)
return nombres
nombres = lista_nombres()
print("La lista es:", nombres)