
November 11th, 2012, 07:15 PM
|
 |
Contributing User
|
|
|
|
|
Strings are immutable. Thus they have a hash that won't change. Therefor they can be dictionary keys.
strings, tuples, frozensets, and um, numbers can be keys. There may be a few other types that can also be used for keys, possibly None, type(object) .
The python3 value returned from input() can be directly used as a dictionary key.
__________________
[code] Code tags[/code] are essential for python code!
|