File size: 253 Bytes
48a8166 | 1 2 3 4 5 6 7 8 9 10 | def loadFileIntoDict(file):
with open(file, "r") as f:
lines = f.readlines()
f.close()
D = {}
for index_genre_pair in lines:
index, genre = index_genre_pair.split(',')
D[int(index)] = genre[:-1]
return D |