About 51 results
Open links in new tab
  1. Mutable strings in Python - Stack Overflow

    May 13, 2012 · A string in Python is a-priori not a "memory-efficient" sequence, but rather concurrency-efficient. Consider this: you can always be sure, that no matter what a string …

  2. 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 …

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

    72 The string objects themselves are immutable. The variable, a, which points to the string, is mutable. Consider:

  4. 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?

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

    Oct 17, 2021 · 1 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 …

  6. How can I emulate a mutable string in Python (like StringBuffer in …

    Nov 12, 2013 · 105 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 …

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

    Mar 1, 2015 · What are the design reasons of making Python strings immutable? How does it make programming easier? I'm used to mutable strings, like the ones in C. How am I …

  8. python - Immutable vs Mutable types - Stack Overflow

    Nov 9, 2011 · Here's a list of the most common mutable and immutable objects in Python. This list can be obtained by 1) painstakingly searching Python's official "Built-in Types" reference page …

  9. 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 …

  10. Creating a Mutable string class in python - Stack Overflow

    Jul 8, 2015 · I threw in the subtraction operator for fun. :) you can continue with the same pattern of creating a function you need that is in the string class, and calling that function on self.string …