I have a file like this:
a,z,1
b,y
c,x,1
d,w,1
e,v
f,u
What I need to do is to create a dictionary that has the characters in the first column as keys and characters in the third column as values. The rest should be ignored, i.e. {a:1, c:1, d:1}. This is what I have so far:
def create_dict(f):
f = open("something.txt")
d = {}
for line in f:
columns = line.split(",")
letters = columns[0]
numbers = columns[2]
I am confused about next steps. Please, help.