Is dictionaries mutable or immutable?

Just started to learn about dictionaries in python. In this creating dictionaries excercise, it is said the even tuples can be used as an value.

Just wondering whether dictionaries are mutable or not?

2 Likes

Dictionaries are unordered, mutable and indexed.

Dictionaries are mutable, but their keys must be immutable, so int, string and tuple may be used as keys, but not list (or dict).

1 Like