How To Create A Dictionary Of The Contents Of An Excel Spreadsheet?
I'm attempting to build a dictionary in Python based off the contents of an Excel spreadsheet file. Here is an example of how the spreadsheet is structured (two columns): Col 1
Solution 1:
[{'Hello': 'World', 'Earth', 'Planet', 'Mars', 'Moon'), ('Hi': 'Pluto', 'Neptune', 'Jupiter'}]
is not valid python dictionary. You can't have multiple values for a key.
However, you can have the value as a list of items, like this
{
'Hello': [
'World',
'Earth',
'Planet',
'Mars',
'Moon'
],
'Hi': [
'Pluto',
'Neptune',
'Jupiter'
]
}
Post a Comment for "How To Create A Dictionary Of The Contents Of An Excel Spreadsheet?"