How can I write a while loop that asks for a user for input, and breaks when the same value is used twice in a row? This is my current attempt, which tries to use len(set(word)) to get the previous word: story = "" while True: word = input("Give me a word: ") if word == "end" or word == len(set(word)): break story += word + " " print(story) Continue reading...