Connor’s code:
#set a variable for word count #while a variable is true is true #ask for a word and inform the user that they can quit #if a word is entered #add to the word count #repeats the loop #if they quit #print out how many words they've entered #break out of the loop WORD_COUNT = 0 while WORD_COUNT >= 0: Word = raw_input("Please enter a word. Input x to quit ") #asks the user for an input if Word == "x": print ("You have put in %s words." % WORD_COUNT) #tells the user the total amount of words they've entered break else: WORD_COUNT += 1 #adds to word count