You can do it as:
lst = ['11 12221\n']
lst = lst[0].split()
list[0]
gets you '11 12221\n'
which you then split()
and assign back to lst
giving you:
['11', '12221\n']
You have to assign the split back to the variable
Note: You should not name your variables as ony of the python reserved words. Use perhaps lst
instead.
If you only want to split at a space
, do: split(' ')
instead.
Demo: http://repl.it/R8w