I have a simple list as below:
lst = ['11 12221/n']
I want to split the first item into a list as below:
['11', '12221']
This seems relatively simple to me but I cant get it to work. My first approach was to do:
lst[0].split()
but when I print list no changes have occurred. I therefore tried:
newLst=[]
for x in lst:
newList.append(x.split())
But from this I get
[['11', '12221\n']]
I think I must fundamentally be misunderstanding list comprehension, could someone explain why my code didnt work and how it should be done?
Thank you