About 17,900,000 results
Open links in new tab
  1. Why are Python strings immutable? Best practices for using them

    Dec 30, 2011 · 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 …

  2. How do I get a substring of a string in Python? - Stack Overflow

    Aug 31, 2016 · And just for completeness, Java is like Python in that the String.substring () method takes start and one-past-end. This one just bit me hard, I had assumed it was length …

  3. How do I append one string to another in Python?

    Dec 14, 2010 · For handling multiple strings in a list, see How to concatenate (join) items in a list to a single string. See How do I put a variable’s value inside a string (interpolate it into the …

  4. python - How to concatenate (join) items in a list to a single string ...

    Sep 17, 2012 · For handling a few strings in separate variables, see How do I append one string to another in Python?. For the opposite process - creating a list from a string - see How do I …

  5. python - Changing a character in a string - Stack Overflow

    Aug 4, 2009 · 13 Strings are immutable in Python, which means you cannot change the existing string. But if you want to change any character in it, you could create a new string out it as …

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

    4 Python strings are immutable. However, a is not a string: it is a variable with a string value. You can't mutate the string, but can change what value of the variable to a new string.

  7. python - Convert all strings in a list to integers - Stack Overflow

    Unlike python 2.x, Here map function will return map object i.e. iterator which will yield the result (values) one by one that's the reason further we need to add a function named as list which …

  8. python - How do I split the definition of a long string over multiple ...

    The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping …

  9. Using "and" and "or" operator with Python strings

    9 Python considers empty strings as having boolean value of "false" and non-empty strings as having boolean value of "true". So there're only two possible outcomes of the expression, i.e. …

  10. How would you make a comma-separated string from a list of …

    What would be your preferred way to concatenate strings from a sequence such that between every two consecutive pairs a comma is added. That is, how do you map, for instance, ['a', 'b', …