# Programmer: 22C:16 class # This program reads a sequence of words, looking for the word "hello". # It is expected that the sequence of words is terminated by the empty # string. If the program does not find "hello" among the first five words, # it quits looking. def search(key = "hello", numRepititions = 5): word = raw_input() while word: if word == key: return True numRepititions = numRepititions - 1 if numRepititions == 0: return False word = raw_input() return False print "Enter the sequence of words" if search(): print "Found it!" else: print "Did not find what I was looking for"