You need to use list.extend instead of list.append.

newlist = []
for word in lines:
    word = word.split(",")
    newlist.extend(word)  # <----
return newlist

Or, using list comprehension:

>>> lst = ['60,78', '70,77', '80,74', '90,75', '100,74', '110,75']
>>> [x for xs in lst for x in xs.split(',')]
['60', '78', '70', '77', '80', '74', '90', '75', '100', '74', '110', '75']
Answer from falsetru on Stack Overflow
๐ŸŒ
Python Guides
pythonguides.com โ€บ split-a-string-by-comma-in-python
How to Split a List in Python by Comma
September 16, 2025 - Instead of manually separating them, Python allows us to automate this process. Splitting by a comma is one of the most common text-processing tasks youโ€™ll face. The easiest way to split a string into a list by a comma is to use Pythonโ€™s built-in split() method.
Discussions

list - How to split by comma and strip white spaces in Python? - Stack Overflow
I have some python code that splits on comma, but doesn't strip the whitespace: >>> string = "blah, lots , of , spaces, here " >>> mylist = string.split(',') >>> print More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to split a python list by comma - Stack Overflow
I have a list similar to: industries_list = ["Computers, Internet","Photography, Tourism","Motoring, Manufacturing"] How can I split this list so that the output would be something like: More on stackoverflow.com
๐ŸŒ stackoverflow.com
January 6, 2014
split element inside list by comma with python - Stack Overflow
I want to check every element in the list and split by comma, making the two new elements stay in the same list. More on stackoverflow.com
๐ŸŒ stackoverflow.com
May 24, 2017
regex - How can I split this comma-delimited string in Python? - Stack Overflow
Hi I have been reading up about regular expressions, I have got some basic res working. I now have been trying to use Re to sort out data like this: "144,1231693144, More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ how-to-convert-comma-delimited-string-to-a-list-in-python
How To Convert Comma-Delimited String to a List In Python? - GeeksforGeeks
August 23, 2025 - ... In this example, split(',') divides the string s at each comma and puts each part (like 'geeks', 'for') into a list p. map() function applies the split() method to each element of the string, which can be useful in more complex scenarios, ...
๐ŸŒ
Data Science Parichay
datascienceparichay.com โ€บ home โ€บ blog โ€บ python โ€“ split string by comma
Python - Split String by Comma - Data Science Parichay
February 25, 2022 - To split a string by comma in Python, pass the comma character "," as a delimiter to the split() function. ... It returns a list of strings resulting from splitting the original string on the occurrences of ",".
๐ŸŒ
Python Examples
pythonexamples.org โ€บ python-split-string-by-comma
How to Split String by Comma in Python?
re.split(regular_expression, string) returns list of items split from string based on the regular_expression. import re str = 'apple,,orange,,,grape' #split string by , chunks = re.split(',+', str) print(chunks) Regular Expression ,+ represents one or more commas. So, one or more commas is considered as a delimiter. ... One ore more adjacent commas is considered as a single delimiter. In this tutorial of Python Examples, we learned how to split a string by comma using String.split() and re.split() methods.
๐ŸŒ
Bobby Hadz
bobbyhadz.com โ€บ blog โ€บ python-convert-comma-separated-string-to-list
Convert a comma-separated String to a List in Python | bobbyhadz
April 9, 2024 - To convert a comma-separated string to a list of integers: Use the str.split() method to split the string on each occurrence of a comma.
Find elsewhere
๐ŸŒ
From-Locals
from-locals.com โ€บ python-split-strip-list-join
Python, split to split a comma-separated string, remove whitespace and convert to a list | From-Locals
December 10, 2021 - If a delimiter is specified in ... but if you run split() with a comma as the delimiter for a string separated by a comma + white space, you will end up with a list of strings with white space left at the beginning...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ split-elements-of-a-list-in-python
Split Elements of a List in Python - GeeksforGeeks
July 23, 2025 - ... a = ['GFG,Website', 'GFG,Online ... the given function to each element of the list a. The lambda function splits each string at the comma and selects the first part....
๐ŸŒ
w3resource
w3resource.com โ€บ python-exercises โ€บ python-basic-exercise-6.php
Python: Generate a list and tuple with comma-separated numbers - w3resource
May 17, 2025 - This method takes a separator as input, in this case ',' (comma) and returns a list of substrings that were separated by the separator. The third line converts the list into a tuple using the tuple() function and assigns it to the variable 'tuple'.
๐ŸŒ
Codingem
codingem.com โ€บ home โ€บ how to convert comma-delimited string to a list in python
How to Convert Comma-Delimited String to a List in Python - codingem.com
November 2, 2022 - To convert comma-delimited string to a list in Python, use str.split() method. For example "A,B,C".split(",") returns a list ["A", "B", "C"]
๐ŸŒ
Kodeclik
kodeclik.com โ€บ python-comma-separated-string-to-list
How to convert a comma-separated string into a list in Python
October 27, 2025 - To convert a comma separated Python string to a list use the split() method on the given string and pass a โ€œcommaโ€ as argument.
๐ŸŒ
Finxter
blog.finxter.com โ€บ home โ€บ learn python blog โ€บ how to create a list from a comma-separated string
How to Create a List from a Comma-Separated String - Be on the Right Side of Change
July 16, 2022 - This method uses List Comprehension in conjunction with split() and map() to convert a comma-separated string into a list.
๐ŸŒ
Stack Abuse
stackabuse.com โ€บ python-split-string-into-list-with-split
Python: Split String into List with split()
March 28, 2023 - Let's take a look at the behavior of the split() method: string = "Age,University,Name,Grades" lst = string.split(',') print(lst) print('Element types:', type(lst[0])) print('Length:', len(lst)) Our string had elements delimited with a comma, as in a CSV (comma-separated values) file, so we've ...
๐ŸŒ
Career Karma
careerkarma.com โ€บ blog โ€บ python โ€บ how to use python split()
How to Use Python split() | Career Karma
December 1, 2023 - Each ingredient in our list is separated using a comma (,). Next, we use the split() method to split up our ingredients string using commas. We use the separator parameter to tell Python that our string should be separated with a comma.
๐ŸŒ
DataCamp
datacamp.com โ€บ home โ€บ tutorials โ€บ python โ€บ how to split lists in python: basic examples and advanced methods
How to Split Lists in Python: Basic and Advanced Methods | DataCamp
June 21, 2024 - Learn-by-Example editor, press Tab to Enter. Press Escape and then Tab or Shift+Tab to navigate out. ... Failing to handle special characters properly may also result in errors when splitting string lists in Python. These special characters include white spaces, commas, or alpha-numerics.
๐ŸŒ
IncludeHelp
includehelp.com โ€บ python โ€บ input-comma-separated-elements-convert-into-list-and-print.aspx
Python | Input comma separated elements, convert into list and print
August 8, 2018 - Input: Enter comma separated integers: ... input() method. Split the elements delimited by comma (,) and assign it to the list, to split string, use string.split() method....