1.

What is the concept of immutable strings ?

Answer»

Strings are immutable means that the contents of string cannot be chrnged after it is created.

For example : 

>>> str = ‘Meney’ 

>>> str [3] = ‘h’

Type Error : ‘str’ object not support item assignment Python does not allow to change a character in a string. So an attempt to replace ‘e’ in the string by ‘h’ displays a Type Error.



Discussion

No Comment Found