303,682 views
12 votes
12 votes
4.5 code practice PUT IN PYTHON LANGUAGE HELP NEEDED

4.5 code practice PUT IN PYTHON LANGUAGE HELP NEEDED-example-1
User Darryl Miles
by
2.9k points

1 Answer

15 votes
15 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 Scott Wales
by
2.9k points