144k views
2 votes
4.5 code practice PUT IN PYTHON LANGUAGE HELP NEEDED

4.5 code practice PUT IN PYTHON LANGUAGE HELP NEEDED-example-1

1 Answer

4 votes

Answer:

wordcount = 0

while (True):

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

if word.lower() == "done": break

wordcount = wordcount+1

print("#%d: You entered the word %s" % (wordcount, word))

print ("A total of %d words were entered." % wordcount)

Step-by-step explanation:

I made the stop word case insensitive, so both done and DONE will work.

User Gary Riches
by
6.1k points