About 3,090,000 results
Open links in new tab
  1. Convert string to a list in Python - GeeksforGeeks

    Oct 16, 2024 · In this article, we’ll explore these conversion techniques with simple examples. The most common ways to convert a string into a list is by using the split () method. The split () method by default splits a string based on spaces, but it can also split using a custom delimiter. Example 1: Splitting a string by space.

  2. Convert String to List in Python - AskPython

    Feb 27, 2020 · When we need to convert a string to a list in Python containing the constituent strings of the parent string (previously separated by some separator like ‘,’ or space), we use this method to accomplish the task.

  3. 7 Powerful Ways To Convert String To List In Python

    Jan 24, 2021 · Convert String to a list of strings in Python using the split() method or typecast it into a string for a list of characters.

  4. python - How to convert string representation of list to a list

    The json.loads(your_data) function can be used to convert it to a list. >>> import json >>> x = '[ "A","B","C" , " D"]' >>> json.loads(x) ['A', 'B', 'C', ' D'] Similarly >>> x = '[ "A","B","C" , {"D":"E"}]' >>> json.loads(x) ['A', 'B', 'C', {'D': 'E'}]

  5. 5 Ways to Convert String to a List in Python - Analytics Vidhya

    Apr 22, 2025 · We can use the map() function and the list() function to convert a string to list python. Here’s an example: string = "Hello World" list = list(map(str, string)) print(list)

  6. How to Convert a String to a List in Python: Step-by-Step Guide

    Feb 25, 2025 · The list() function is a built-in Python function that converts an iterable (like a string, tuple, or set) into a list. This is particularly useful when you need to manipulate individual elements of an iterable or when you want to convert a string into a list of characters.

  7. Convert String to List in Python Without Using Split - Python

    Apr 23, 2025 · Learn how to convert a string to a list in Python without using split(). Explore methods like list comprehensions, loops, and regex with detailed examples.

  8. How To Convert String To List In Python? 9 Ways +Examples // …

    The most frequently used methods include using split() for delimiter-based splitting, list() for converting a string into a list of characters, list comprehensions for custom conversions, and json.loads() or ast.literal_eval() for strings that represent literal Python data structures.

  9. Splitting Strings into Lists in Python: A Comprehensive Guide

    Apr 23, 2025 · In Python, working with strings and converting them into lists is a common operation. This skill is crucial for various tasks such as data processing, text analysis, and parsing information. Splitting a string into a list allows you to break down a single long string into smaller, more manageable parts. This blog post will explore the different ways to …

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

    Oct 21, 2011 · You can use this function to convert comma-delimited single character strings to list-def stringtolist(x): mylist=[] for i in range(0,len(x),2): mylist.append(x[i]) return mylist

Refresh