RosettaCodeData/Task/Associative-array-Creation/Python/associative-array-creation-1.py

5 lines
154 B
Python
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
hash = dict() # 'dict' is the dictionary type.
hash = dict(red="FF0000", green="00FF00", blue="0000FF")
hash = { 'key1':1, 'key2':2, }
value = hash[key]