brewersfan1976

ch3-ex4.py

Jul 15th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. # Capitalizes the first letter of each word in a list
  2.  
  3. import string
  4.  
  5. userInput = raw_input("Please enter a sentence:")
  6.  
  7. list = []
  8.  
  9. capitalize_string = string.capwords(userInput, ' ')
  10.  
  11. for w in capitalize_string.split():
  12.     list.append(w)
  13.  
  14. print list
Advertisement
Add Comment
Please, Sign In to add comment