I am trying to look at a .txt file and make a list of words in it. I want the words to be strings, but the ouput makes them lists.
import csv, math, os
os.chdir(r'C:\Users\jmela\canopy')
f=open("romeo.txt")
words = []
for row in csv.reader(f):
line = str(row)
for word in line.split():
if word not in words:
print word
words.append(word)
words.sort()
print words
Does anyone know what I am doing wrong?
[in them. See @Kasra comment for why