1 2 3 4 5 6 7 8
def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'