About 275,000 results
Open links in new tab
  1. How to convert variable into string in python - Stack Overflow

    Feb 3, 2012 · How to convert variable into string in python Asked 13 years, 10 months ago Modified 1 year, 7 months ago Viewed 78k times

  2. How to change any data type into a string? - Stack Overflow

    Jul 8, 2010 · I wouldn't use repr (myvariable) - it often returns information about class type, memory address etc. It's more useful for debugging. Use str (myvariable) for conversion to string and unicode …

  3. python - How do I put a variable’s value inside a string (interpolate ...

    See for example How to use variables in SQL statement in Python? for proper techniques. If you just want to print (output) the string, you can prepare it this way first, or if you don't need the string for …

  4. Convert string to variable name in python - Stack Overflow

    buffalo=4 not only this example, I want to convert any input string to some variable name. How should I do that (in python)?

  5. python - Using a string variable as a variable name - Stack Overflow

    Jul 19, 2012 · I have a variable with a string assigned to it and I want to define a new variable based on that string.

  6. Convert integer to string in Python - Stack Overflow

    Jun 23, 2019 · Note: A variable in the format of string can be converted into an integer only if the variable is completely composed of numbers. In the same way, str () is used to convert an integer to …

  7. python - Insert variable values into a string - Stack Overflow

    Closed 5 years ago. I want to introduce a variable [i] into a string in Python. For example look at the following script. I just want to be able to give a name to the image, for example geo[0].tif ... to …

  8. python - How to use a variable inside a regular expression - Stack …

    As of 2020, this is the simplest and most pythonic way to use a variable inside a regular expression

  9. Convert regular Python string to raw string - Stack Overflow

    I have a string s, its contents are variable. How can I make it a raw string? I'm looking for something similar to the r'' method.

  10. python - Getting the name of a variable as a string - Stack Overflow

    Aug 25, 2013 · I already read How to get a function name as a string?. How can I do the same for a variable? As opposed to functions, Python variables do not have the __name__ attribute. In other …