Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # this program take a string and creates a list by each word and counts
- # the number of words in the list
- userInput = raw_input("Please enter a sentence: ")
- words = 0
- for w in userInput.split():
- words = words + 1
- print "There are", words, "words in the list."
Advertisement
Add Comment
Please, Sign In to add comment