Problem scenario
You have a multi-line variable in Python. You want to convert each line to be its own item in a list. How do you make a multi-line string variable to become a list with the same contents?
Solution
Use the .splitlines() method to manipulate the string in this way.
Here is an example:
list_of_input=”””a line here
another line there. …
Continue reading “Using Python How Do You Convert Each Line to Be an Item in a List?”