About 14,900,000 results
Open links in new tab
  1. How to change any data type into a string? - Stack Overflow

    Jul 8, 2010 · The rule of thumb for repr is that if it makes sense to return Python code that could be evaluated to produce the same object, do that, just like str, frozenset, and most other builtins do, but …

  2. python - How to resolve TypeError: can only concatenate str (not "int ...

    How to resolve TypeError: can only concatenate str (not "int") to str [duplicate] Asked 7 years, 6 months ago Modified 2 years, 9 months ago Viewed 674k times

  3. 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 split a …

  4. Convert integer to string in Python - Stack Overflow

    Jun 23, 2019 · 17 For Python 3.6, you can use the f-strings new feature to convert to string and it's faster compared to str () function. It is used like this:

  5. python - How to convert string representation of list to a list - Stack ...

    As recent versions of the docs explain: "Warning It is possible to crash the Python interpreter with a sufficiently large/complex string due to stack depth limitations in Python’s AST compiler."

  6. python - How do I pad a string with zeros? - Stack Overflow

    How do I pad a numeric string with zeroes to the left, so that the string has a specific length?

  7. string - strip () vs lstrip () vs rstrip () in Python - Stack Overflow

    strip () vs lstrip () vs rstrip () in Python Asked 9 years, 1 month ago Modified 2 years, 5 months ago Viewed 31k times

  8. python - 'str' object does not support item assignment - Stack Overflow

    I would like to read some characters from a string s1 and put it into another string s2. However, assigning to s2[j] gives an error: s2[j] = s1[i] # TypeError: 'str' object does not support item

  9. python - How to check if type of a variable is string? - Stack Overflow

    Jan 30, 2011 · Is there a way to check if the type of a variable in python is a string, like: isinstance(x,int); for integer values?

  10. python - How does str (list) work? - Stack Overflow

    The str() function in python is used to turn a value into a string. The simple answer to what the str() does to a list is that it creates a string representation of the list (square brackets and all).