Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. def wordCounter():
  2.     wordList = []
  3.  
  4.     word = str(input("Enter your word: "))
  5.  
  6.     while word != "exit":
  7.         wordList.append(word)
  8.         word = str(input("Enter your word: "))
  9.         wordCount = len(wordList)
  10.  
  11.     print("You inputted %d words" % (wordCount))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement