You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def ffr(ls): # find first repeated word in sentence
sw = set()
w = None
es= "|" # end of sentence
for i in ls:
if i == es:
break
elif i not in sw:
sw.add(i)
else :
w = i # first repeated word in sentence
break
return w
s = "one two bye yes Two one. "
s1 = "Hola, Hola hola. "
s2 = "He had had quite enough of this games of;; of. "
s3 = ".Ciao."
c = " | "
s = s.lower().replace(".", c).replace("-", c).replace(",", c).replace(":", c).replace(";", c) #here to change the sentence. E.g.: s = s1.lower().replace..