271,758 views
8 votes
8 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 Charleslparker
by
2.5k points

1 Answer

14 votes
14 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 Samit
by
2.7k points