Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Capitalizes the first letter of each word in a list
- import string
- userInput = raw_input("Please enter a sentence:")
- list = []
- capitalize_string = string.capwords(userInput, ' ')
- for w in capitalize_string.split():
- list.append(w)
- print list
Advertisement
Add Comment
Please, Sign In to add comment