Mutable and immutable are English words meaning “can change” and “cannot change” respectively. The meaning of the words is the same in the IT context; i.e.
- a mutable string can be changed, and
- an immutable string cannot be changed
String are immutable, if we run following code it throw an error
varstr=’string is immuttable’
TypeError: ‘str’ object does not support item assignment
Tuple are also immutable:
vartup=’this is immutable’
List are mutable:
Dictionary are mutable:
Hello there! This is my 1st comment here so I just wanted to give a quick shout out and say I genuinely enjoy reading your articles. Can you suggest any other blogs/websites/forums that cover the same subjects? Thanks!
Greetings from Ohio! I’m bored at work so I decided to
check out your blog on my iphone during lunch break. I enjoy the knowledge
you present here and can’t wait to take a look when I get
home. I’m amazed at how quick your blog loaded on my phone ..
I’m not even using WIFI, just 3G .. Anyways, amazing site!