Answers for "python 2d dictionary"

0

2d dictionary in python

# It would have the following syntax
dict_names = {'d1' : {'name':'bob', 'place':'lawn', 'animal':'man'},
              'd2' : {'name':'spot', 'place':'bed', 'animal':'dog'}}

# You can then look things up like
>>> dict_names['d1']['name']
'bob'
Posted by: Guest on August-31-2021

Python Answers by Framework

Browse Popular Code Answers by Language