Add list to dictionary Python | Example code
tutorial.eyehunts.com › python › add-list-toOct 29, 2021 · Example Add list to dictionary Python. Simple example code. The restriction with keys in the python dictionary is only immutable data types can be used as a key. So, we cannot use a dictionary of the list as a key. If we try to do this we will get a “TypeEerror”. myDict = {"A": 0} # Adding list as value myDict ["key1"] = [1, 2] # A list lst ...