How To Convert Comma-Delimited String to a List In Python? Last Updated : 12 Apr, 2025 Comments Improve Suggest changes Like Article Like Report In Python, converting a comma-separated string to a list can be done by using various methods. In this article, we will check various methods to convert a comma-delimited string to a list in Python.Using str.split()The most straightforward and efficient way to convert a comma-delimited string to a list is by using Python’s built-in split() method. This method works by splitting the string based on a given delimiter. Python s = "geeks,for,geeks" p = s.split(',') print(p) Output['geeks', 'for', 'geeks'] Explanation:In this example, split(',') divides the string s at each comma and puts each part (like 'geeks', 'for') into a list p.Using map() with split()map() function applies the split() method to each element of the string, which can be useful in more complex scenarios, such as if we need to apply additional transformations after splitting. Python s = "geeks, for,geeks" r= list(map(str, s.split(','))) print(r) Output['geeks', ' for', 'geeks'] Using List ComprehensionWe can use list comprehension for splitting and further processing, such as removing whitespace or converting elements. Python s = "Geeks,for,geeks" r = [item.strip() for item in s.split(',')] print(r) Output['Geeks', 'for', 'geeks'] Related Articles:Python String split()Python map() functionPython String split()Python Tutorial Comment More infoAdvertise with us Next Article How To Convert Comma-Delimited String to a List In Python? E everythingtech Follow Improve Article Tags : Python Python Programs python-string Practice Tags : python Similar Reads Convert String Float to Float List in Python We are given a string float we need to convert that to float of list. For example, s = '1.23 4.56 7.89' we are given a list a we need to convert this to float list so that resultant output should be [1.23, 4.56, 7.89].Using split() and map()By using split() on a string containing float numbers, we c 2 min read How to Convert Tab-Delimited File to Csv in Python? We are given a tab-delimited file and we need to convert it into a CSV file in Python. In this article, we will see how we can convert tab-delimited files to CSV files in Python. Convert Tab-Delimited Files to CSV in PythonBelow are some of the ways to Convert Tab-Delimited files to CSV in Python: U 2 min read Convert List to Delimiter Separated String - Python The task of converting a list to a delimiter-separated string in Python involves iterating through the list and joining its elements using a specified delimiter. For example, given a list a = [7, "Gfg", 8, "is", "best", 9] and a delimiter "*", the goal is to produce a single string where each elemen 3 min read Python | Convert string enclosed list to list Given a list enclosed within a string (or quotes), write a Python program to convert the given string to list type. Examples: Input : "[0, 2, 9, 4, 8]" Output : [0, 2, 9, 4, 8] Input : "['x', 'y', 'z']" Output : ['x', 'y', 'z'] Approach #1: Python eval() The eval() method parses the expression passe 5 min read Python Program to Convert a List to String In Python, converting a list to a string is a common operation. In this article, we will explore the several methods to convert a list into a string. The most common method to convert a list of strings into a single string is by using join() method. Let's take an example about how to do it.Using the 3 min read Like