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

    May 5, 2025 · The most common way 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 …

  2. python - How do I split a string into a list of words ... - Stack Overflow

    The str().split() method does this, it takes a string, splits it into a list: >>> the_string = "this is a sentence" >>> words = the_string.split(" ") >>> print(words) ['this', 'is', 'a', 'sentence'] >>> …

  3. Python String split() Method - W3Schools

    The split() method splits a string into a list. You can specify the separator, default separator is any whitespace.

  4. Python Split String – How to Split a String into a List or Array in Python

    Apr 4, 2023 · In this article, we will walk through a comprehensive guide on how to split a string in Python and convert it into a list or array. We'll start by introducing the string data type in …

  5. 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 …

  6. Convert Strings to Lists and Dictionaries in Python

    May 11, 2025 · Besides split(), Python also provides methods like splitlines() for splitting on line breaks, and re.split() for splitting based on regular expressions. For more on these, see the …

  7. Different Methods to Slice a String - TechBeamers

    Apr 18, 2025 · How to Slice a String in Python? The simplest way to slice a string in Python is by using square brackets ([]), also known as the slice operator. Other methods like slice(), split(), …

  8. How to Split a String into a List in Python - Intellipaat

    5 days ago · The most basic way to split a string into lists is using the split () function in Python. This method splits a string based on a delimiter and returns a list of substrings. It is important …

  9. 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: …

  10. String Slicing in Python - GeeksforGeeks

    Apr 9, 2025 · String slicing in Python is a way to get specific parts of a string by using start, end and step values. It’s especially useful for text manipulation and data parsing. Let’s take a quick …

Refresh