I want to make a program that detects duplicate words as in the following example:
"At least one value must be entered
entered in order to compute the average"
We can see that "entered" is repeated and I want to find a way to detect this type of cases. \
archivo = str(input("Ingrese la ubicación del archivo: "))
inf = open(archivo, "r")
lineas = inf.readlines()
lin = []
for a in lineas:
lin.append(a.strip())
cadena = ' '.join([str(item) for item in lin])
list_cadena = cadena.split()
I have done this but I don't know how to detect the repeated words because they can be in the same line or it can happen that one is at the end of a line of text and another at the beginning of the next, as in the example
~
symbols at the top and bottom of the code