About 354,000 results
Open links in new tab
  1. python - How to convert string representation of list to a list

    Here is an implementation of a function to convert a string to a list that isn't very short, but it is very simple and straightforward and does exactly what you would expect it to and what you …

  2. python - How to convert list to string - Stack Overflow

    Apr 11, 2011 · str(anything) will convert any python object into its string representation. Similar to the output you get if you do print (anything), but as a string.

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

    Here, append () is used to add items ( i.e integer version of string (i) in this program ) to the end of the list (b). Note: int () is a function that helps to convert an integer in the form of string, back to …

  4. How to convert comma-delimited string to list in Python?

    Oct 21, 2011 · #splits string according to delimeters ''' Let's make a function that can split a string into list according the given delimeters. example data: cat;dog:greff,snake/ example …

  5. How to convert a string list into an integer in python

    There's no ' to remove in the list. When you print a list, since it has no direct string representation, Python shows you its repr —a string that shows its structure. You have a list with one item, the …

  6. How do I split a string into a list of words? - Stack Overflow

    To split on other delimiters, see Split a string by a delimiter in python. To split into individual characters, see How do I split a string into a list of characters?.

  7. python - How do I split a string into a list of characters? - Stack ...

    Feb 12, 2011 · The task boils down to iterating over characters of the string and collecting them into a list. The most naïve solution would look like result = [] for character in string: …

  8. How to convert a string with comma-delimited items to a list in …

    Mar 22, 2011 · So, if stripping of whitespaces is desired while splitting a string based on a non-whitespace delimiter, use this construct: words = [item.strip() for item in string.split(',')] When a …

  9. python - Convert list of strings to dictionary - Stack Overflow

    Apr 10, 2014 · This assumes that you do not have duplicates and you don't have other colons in there. What happens is that you first split the strings into a tuple of two values. You do this …

  10. python - convert list into string in python3 - Stack Overflow

    Oct 10, 2010 · You can use the join method on strings and have to convert the data in the list to strings first. >>> '.'.join(map(str, deints)) '10.10.10.50' join takes the string as a delimiter and …