Problem scenario
List operations such as .sort() will change previous copies of the list.
String operations such as .replace(“old_pattern”, “new_pattern”, count), will not change the variable or its copies; these operations will return a string after the replace operation has run on the original string.
Why is this behavior happening?
Solution
In place changes and mutability are factors.