Skip to content
Advertisement

How to create a dictionary of lists from each row of a text file?

I have a text file with this data

JavaScript

I have something like this but it only works if you have the ID and name alone

JavaScript

print (d) Can I create a dictionary from this file that would look like this:

JavaScript

Advertisement

Answer

This is a bit more simple.

JavaScript

hope this works

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement