Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python tuple key dictionary

'''
Dictionaries need hashable data as key.
Lists are not hashable so you can't use them as a key.
Tuples are hashables.
A way to do is to convert list to tuple before using them as a
 dictionary key
'''
Source by pythonguides.com #
 
PREVIOUS NEXT
Tagged: #python #tuple #key #dictionary
ADD COMMENT
Topic
Name
5+6 =