4 ms·
> You can't replace a value in a tuple, but you can modify it If it has mutable items in it, yes. But in that case, the tuple can't be used as a dictionary key
by pdonis 10y ago
> You can't replace a value in a tuple, but you can modify it
If it has mutable items in it, yes. But in that case, the tuple can't be used as a dictionary key; Python checks, not just that the tuple itself is immutable, but that every object in it is immutable.