About 411,000 results
Open links in new tab
  1. python - How to convert list to string - Stack Overflow

    Apr 11, 2011 · How can I convert a list to a string using Python?

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

    275 The json module is a better solution whenever there is a stringified list of dictionaries. The json.loads(your_data) function can be used to convert it to a list.

  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. python - Converting a String to a List of Words? - Stack Overflow

    May 31, 2011 · I'm trying to convert a string to a list of words using python. I want to take something like the following: string = 'This is a string, with words!' Then convert to something like this : list = ...

  5. String to list in Python - Stack Overflow

    Off-topic, but for search's sake : Convert string representation of list to list.

  6. python - Find and replace string values in list - Stack Overflow

    Find and replace string values in list [duplicate] Asked 15 years, 5 months ago Modified 1 year, 11 months ago Viewed 601k times

  7. python - How to sort a list of strings? - Stack Overflow

    Aug 30, 2008 · As sort() sorts the list in place (ie, changes the list directly), it doesn't return the sorted list, and actually doesn't return anything, so your print statement prints None. If you saved your list to …

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

    Jan 28, 2010 · This simple filtering can be achieved in many ways with Python. The best approach is to use "list comprehensions" as follows:

  9. python - How to iterate over each string in a list of strings and ...

    Jan 7, 2014 · Traceback (most recent call last): File "<stdin>", line 2, in <module> TypeError: list indices must be integers, not str How would I achieve comparing the first and the last element of a list of …

  10. Coverting all the list elements to string using Python?

    Jan 6, 2021 · Another way to do the same thing is by using the map function in python. However for efficiency reason, the type of the output is of type Map[str] instead of type List[str].