Jan-21-2017, 05:17 PM
Wow! Yeah, the keys can be anything immutable, meaning you can't change its value. For example, you can't change a string, tuple or integer in-place, you have to replace the whole variable. Contrast that with a list, which can change. The dictionary would then have issues if the way it organizes things internally relies on the keys not changing, so that's a high-level explanation of why.