Find duplicate words in string python code example
Example: how to find 2 similar words in atext python
words = sentence.split()
counts = {}
for word in words:
if word not in counts:
counts[word] = 0
counts[word] += 1
words = sentence.split()
counts = {}
for word in words:
if word not in counts:
counts[word] = 0
counts[word] += 1