Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Implement a function word_list() that reads the 5_letter_words.txt file and returns a list of the words in the file.

def getWords(filepath):
    with open('filepath') as f:
        return list(itertools.chain(line.split() for line in f))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Implement #function #reads #file #returns #list #words
ADD COMMENT
Topic
Name
7+5 =