strings immutable , id values for strings - Python | Python Tutorial for Beginners in telugu Part 12

Published: 03 November 2020
on channel: ottit
257
5

#ottit #pythontutorial
Is Strings in python Immutable ? How?

String is immutable : on each modification of the string content a new string variable is created as name same as old string variable name with new modified content. Old string variable is deleted from memory. It seems to be string modified , but re-created using old name with new content. It can be identified by checking id value of the stings before and after modifications.

Each string object is identified by unique id value, irrespective of the type of content in it. When the string variables are with same content including case (lower case and upper case) for that variables , id values are same.

In simple words , variables with same content in all aspects like type , size , case then that variables with same id.

Memory optimization and performance.


On this page of the site you can watch the video online strings immutable , id values for strings - Python | Python Tutorial for Beginners in telugu Part 12 with a duration of hours minute second in good quality, which was uploaded by the user ottit 03 November 2020, share the link with friends and acquaintances, this video has already been watched 257 times on youtube and it was liked by 5 viewers. Enjoy your viewing!