def findWords() : concordance = [] print("Type your sentence, one word per line") word = None while True : word = input(": ") if word == "QUIT" : break if not word in concordance : concordance.append(word) print("There were", len(concordance), "distinct words") for word in concordance : print(word,",", sep='', end='') print() def findWords2() : concordance = [] line = input("Type your sentence: ") words = line.split() for word in words : if not word in concordance : concordance.append(word) print("There were", len(concordance), "distinct words") for word in concordance : print(word,",", sep='', end='') print() findWords() print("------------") findWords2()