count the number of times each word appears in the input ===================== dictionary has words as keys, number of times word appears as values get word if end of input quit look word up in dictionary if not there, add the word and value 1 if there, add 1 to the value associated with word get next word repeat ==================== wct = {} # w = dict() while True: try: w = input("word> ") except: break if w in dictionary: wct[w] = wct[w] + 1 else: wct[w] = 1 for i in list(d.keys()): print(i, d[i])