I have a file which contains data in the following format: please note this is an example of what it looks like, the actual file contains more than 2 rows
1 30 5
2 64 4
I read in the file, convert the text to integers, and store them into a list. This is done with the following code:
file = open("dataFile.txt", "r")
items = []
for line in file:
line = map(int,line.split()) #convert the text data to integers
items.append(line) #add text data to list
The current format for the list looks like:
[[1, 30, 5], [2, 64, 4]]
I need to turn my list of lists into a dictionary. How would one go about doing this?
Dictionary key should be the first element