The more common approach would be to use append() ...
for line in f:
columns = line.split(",")
letters = columns[ 0 ]
list1.append(letters)
I think it is less mistake prone. I also want to point out, that should you want to read the second column (the end of each line), you will find a newline character attached.
Since you title is
File to dictionary this may become important.
Last edited by vegaseat; Nov 3rd, 2009 at 5:00 pm. Reason: newline
Reputation Points: 1333
Solved Threads: 1404
DaniWeb's Hypocrite
Offline 5,792 posts
since Oct 2004