Skip to content

Instantly share code, notes, and snippets.

@gunnarig
Created October 8, 2018 15:37
Show Gist options
  • Save gunnarig/61a2b64cc8e76511e4ad02214ccfd3b0 to your computer and use it in GitHub Desktop.
Save gunnarig/61a2b64cc8e76511e4ad02214ccfd3b0 to your computer and use it in GitHub Desktop.
def get_word_string(user_file):
user_file = open(user_file,"r")
list_of = []
wordString = '' # start with an empty string of words
for line in user_file:
line.split()
wordString += line # add each line of words to the word string
rejoin = list_of.append(wordString)
#remove = rejoin.replace(", ","").replace("\n"," ")
#list_it = remove.split(" ")
print(rejoin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment