Respuesta :

Question: Write a loop that inputs words until the user enters STOP.

Answer:

count = 0

word = input("User Input: ")

while word!="STOP":

    count = count+1

    print("You entered: "+str(word))

    word = input("User Input: ")

print("All done. "+str(count)+" words entered")

Step-by-step explanation:

This line initializes counter variable count to 0

count = 0

This line prompts user for input

word = input("User Input: ")

The following iteration is executed until user enters STOP

while word!="STOP":

This increments counter variable by 1

    count = count+1

This prints the word entered by the user

    print("You entered: "+str(word))

This line prompts user for another input

    word = input("User Input: ")

This prints the number of input by the user

print("All done. "+str(count)+" words entered")

fnej

Answer:

c = 0

word = input("Enter a word: ")

while word!="STOP":

  c = c+1

  print("#" + str(c) + ": You entered "+str(word))

  word = input("Please enter the next word: ")

print("All done. "+str(c)+" words entered.")