with open("python file example") as file:
new_list = [word.rstrip('\n') for word in file]
print(new_list)
list_of_words = []
for line in new_list:
*for word in line:
list_of_words.append(word)*
print(list_of_words)
I am getting into managing files with python:
My second for loop returns a list of letters instead of words for some reason, what's the problem?