Just learning Python, and, an extremely basic but serious question around mutablility, as I want to understand the core concepts here.
Strings are immuteable, meaning, once a value is assigned it cant be changed. Unlike for example, an integer. This confuses me, because if I run the below code, I can change the value of the string and the integer so ... are they both not muteable?
What is the key concept here I am missing? Is mutability more about the Type? i.e. Type(myString) ..
mystring = "hello"
myint = 1
print(mystring)
print(myint)
hello
1
mystring = "nolongerhello"
myint = 2
print(mystring)
print(myint)
nolongerhello
2
Thanks C