i got a problem.. I have a txt file that looks like this:
a
b
c
d
One letter per row, there is not two values per row, so nothing to split..
This code works, if I add a second value in my alphabetFile.
dict = {}
with open("alphabet.txt") as alphabetFile:
for line in alphabetFile:
(key, val) = line.split()
dict[int(key)] = val
print(dict)
But I should only have 1 value per row... Im thinking the iteration should be the second value.. but im stuck and tired.. any ideas?