52.8k views
0 votes
Write a loop that inputs words until the user enters DONE. After each input, the program should number each entry and print in this format:

#1: You entered _____
When DONE is entered, the total number of words entered should be printed in this format:

A total of __ words were entered.

Write a loop that inputs words until the user enters DONE. After each input, the program-example-1
User Nisanio
by
2.9k points

1 Answer

2 votes

Answer:

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

count = 0

while word != "DONE":

count += 1

print("#{}: You entered the word {}".format(count, word))

print("A total of {} words were entered.".format(count))

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

print("A total of {} words were entered.".format(count))

User Pat Lillis
by
3.6k points