Python
What I need is a dictionary with the following information:
YAHOO:YHOO
GOOGLE INC:GOOG
HARLEY-DAVIDSON=HOG
This is all in a textfile, I need to open this and get it into a dictionary which I can use later to get something out. The problem is (as me being a beginning programmer) that I dont know exactly how to do it.
This is what I made so far, but can't figure out how to make it work:
d={}
def(tickets):
infile=open("tickets","r")
for row in infile:
d(row(0)) = (row(1))
and it give an error: Can't assign to function call.
What did I do wrong and how can I make it work?
What I need is a dictionary with the following information:
YAHOO:YHOO
GOOGLE INC:GOOG
HARLEY-DAVIDSON=HOG
This is all in a textfile, I need to open this and get it into a dictionary which I can use later to get something out. The problem is (as me being a beginning programmer) that I dont know exactly how to do it.
This is what I made so far, but can't figure out how to make it work:
d={}
def(tickets):
infile=open("tickets","r")
for row in infile:
d(row(0)) = (row(1))
and it give an error: Can't assign to function call.
What did I do wrong and how can I make it work?