def read_wiktionary(file):
infile=open(file,'r')
content=infile.readlines()
infile.close()
d = dict()
for i in content:
d[i]=i[1]
return d
File is on notepad has about 30 lines. Each line has a word separated by a comma and then the number of occurrences the word appears in English language. I know i[1]
is out of range but I cant figure our how to make it in range so this works. Help please.
File content:
a,1
be,2
see,3
Expected result:
{'a':'1', 'be':'2', 'see':'3'}