About 50 results
Open links in new tab
  1. Is python += string concatenation bad practice? - Stack Overflow

    Sep 24, 2016 · When joining strings Python only has to allocate new memory for the final string, which is much more efficient, but could take longer to compute. Also, because strings are …

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

  3. How can I selectively escape percent (%) in Python strings?

    May 21, 2012 · How can I selectively escape percent (%) in Python strings? Asked 13 years, 7 months ago Modified 5 years, 1 month ago Viewed 500k times

  4. python - I know of f-strings, but what are r-strings? Are there …

    Sep 17, 2018 · Since you're using f -strings, I'll assume you have at least Python 3.6. Not all of these options are supported for older versions but any of the following prefixes are valid in …

  5. What does %s mean in a Python format string? - Stack Overflow

    15 %s indicates a conversion type of string when using Python's string formatting capabilities. More specifically, %s converts a specified value to a string using the str() function. Compare …

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

  7. Single quotes vs. double quotes in Python - Stack Overflow

    Sep 11, 2008 · Triple quoted comments are an interesting subtopic of this question. PEP 257 specifies triple quotes for doc strings. I did a quick check using Google Code Search and …

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

  9. Filtering a list of strings based on contents - Stack Overflow

    Jan 28, 2010 · Filtering a list of strings based on contents Asked 15 years, 10 months ago Modified 5 years, 7 months ago Viewed 300k times

  10. python - Convert a list with strings all to lowercase or uppercase ...

    I have a Python list variable that contains strings. Is there a function that can convert all the strings in one pass to lowercase and vice versa, uppercase?