Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getWords():
- ''' Creates a list from words recieved from the user until the user states he is finished by entering the keyword. Returns the created list '''
- wordlist = []
- print "What words would you like in the list? Note that any line that contains the word \"zebra\" will not be included in the list. When finished enter ZeBrA."
- getwords = raw_input("Please enter the words you would like in your word list. ")
- while getwords != "ZeBrA":
- """splitwords = getwords.split()
- print splitwords
- wordlist.append(splitwords)"""
- wordlist.append(getwords)
- getwords = raw_input("Enter some more words (or ZeBrA to stop) ")
- for x in wordlist:
- print wordlist
- #for y in splitwords:
- if x == "zebra":
- wordlist.remove(x)
- print wordlist
- getWords()
Add Comment
Please, Sign In to add comment