I am new in python, and I just find something strange:
>>> test="acdefg"
>>> test.replace('a','h')
'hcdefg'
>>> test
'acdefg'
>>> test=[1,2,3]
>>> test.reverse()
>>> test
[3, 2, 1]
As you can see in the code, in the first time, variable "test" is a string, when I call method "replace", the value of "test" doesn't change, the second time is is a list, and the list changed after I called the method reverse().
Why was that? Is it because of something different between the methods or something different between the objects or something else?