About 26,000 results
Open links in new tab
  1. Mutable and Immutable Strings in python - Stack Overflow

    Nov 14, 2017 · Strings are known as Immutable in Python (and other languages) because once the initial string is created, none of the function/methods that act on it change it directly, they simply …

  2. Mutable strings in Python - Stack Overflow

    May 13, 2012 · He's also asking specifically for a library which provides mutable strings in Python (or some other approach to attain it). – Please revise your answer and explain why doing it in this way is …

  3. Aren't Python strings immutable? Then why does a + " " + b work?

    Initially, 'a' is stored in 139831803293008 memory location, as the string object is immutable in python if you try to modify and reassign the reference will be removed and will be a pointer to a new memory …

  4. python - Immutable vs Mutable types - Stack Overflow

    Nov 9, 2011 · In Python, think of variables as objects containing pointers to other objects, where everything is an object, and each object contains a bit specifying whether it is mutable or immutable, …

  5. Why are Python strings immutable? Best practices for using them

    Mar 1, 2015 · Immutable strings are much more dangerous than mutable strings in certain contexts. A best practice list should include never temporarily storing passwords or keys as strings in python.

  6. Why are python strings and tuples made immutable?

    Oct 8, 2009 · I am not sure why strings and tuples were made to be immutable; what are the advantages and disadvantage of making them immutable?

  7. How can I emulate a mutable string in Python (like StringBuffer in Java ...

    Nov 12, 2017 · 104 Since Python's strings are immutable, it's inefficient to edit them repeatedly in loops. How can I use a mutable data structure to implement string operations, so as to avoid making lots of …

  8. Python strings - immutability of strings - Stack Overflow

    Sep 3, 2018 · 3 Strings in Python are immutable which means that once a string variable is assigned to a string (For eg a ='Hello') the contents of the string cannot be changed unlike the list object. In the …

  9. Are python strings can be mutable? - Stack Overflow

    Oct 17, 2021 · We know string is immutable,but we can't change values through assignment operator.so we can acheive this through string slicing: s = s [:5]+'-'+s [6:] so now s becomes "hello-world". so this …

  10. Python are strings immutable - Stack Overflow

    Python strings are immutable. What you're doing is just reassigning the a variable with two different strings, that has nothing to do with immutability. In the code shown no new variables are being …