Content deleted Content added
→Tcl: Fixing style/layout errors |
for python, added distinction of list-like (rather than array-like) character of dictionary |
||
Line 1,105:
{'J. Random Hacker': '553-1337', 'John Doe': '555-1212'}
</source>
Strictly speaking, a dictionary is a super-set of an associative array since neither the keys or values are limited to a single datatype. One could think of a dictionary as an ''associative list'' using the nomenclature of Python. For example the following is also legitimate:
<source lang=Python>
phonebook = {
'Sally Smart': '555-9999',
'John Doe': None,
'J. Random Hacker': -3.32,
14: '555-3322',
}
</source>
The dictionary keys must be of an [[Immutable object|immutable]] data type. In Python, strings are immutable due to their method of implementation.
=== [[REXX]] ===
|