#------------------------------------------------------------------------------- # Words.py #------------------------------------------------------------------------------- def find_first_2_letter_word(L): count = 0 for w in L: #print(" iteration: "+str(count)+", w = "+w) count += 1 if len(w) == 2: return w # exit the loop early # end if #end for return "" # try commenting out this line # find_first_2_letter_word() # function main() ------------------------------------------------------------- def main(): word = find_first_2_letter_word(["This", "is", "a", "dead", "parrot"]) print(word) word = find_first_2_letter_word(["This", "isn't", "a", "dead", "parrot"]) print(word) # end main() # closing conditional --------------------------------------------------------- if __name__=='__main__': main() # end