I have a multi-line string which looks like this:
something1
something2
something3
I'm wanting to send each line of this string to a list so that result[0] = something1
and so on.
I have tried doing this:
for line in tableOut:
results.append(line.strip().split('\n'))
However, this makes every character of the string sent to a unique index in the list.
For example:
[['s'], ['o'], ['m'], ['e'], ['t'], ['h'], ['i'], ['n'], ['g'], ['1']]
Why isn't this working, and how can I send each line of a multi line string to a unique index in a list within a for loop?