Python program to find the first repeated word in a string
In this tutorial, you will learn how to write a python program to find the first repeated word in a string
from collections import Counter text = "python is the best best programming language" split = text.split(' ') print(split) data = Counter(split) for key in data: if dict[key]>1: print (key)
Output:
best