str1 = “hello”
print(id(str1))
str1 = “bye”
print(id(str1))
Notice, when we assign a new value to str1
(at line 4 ) its identity changes not the value.
identity means memory here, the above means every time we assign a value will it create new memory?
Course: Educative: Interactive Courses for Software Developers
Lesson: Educative: Interactive Courses for Software Developers