def main(): print 'Hello, this program allows to enter the words,', print 'one by one until a duplicate is met' print 'Start entering the words:' l=[] while True: next_word=raw_input() if next_word in l: break else: l.append(next_word) print l main()