How do i make something like
x = \'1 2 3 45 87 65 6 8\' >>> foo(x) [1,2,3,45,87,65,6,8]
I\'m completely stuck, if i do it by inde
No need to worry, because python provide split() function to change string into a list.
x='1 2 3 4 67 8 9' x.split()
['1', '2', '3', '4', '67', '8']
or if you want output in integer form then you can use map function
map(int ,x.split(' '))
[1, 2, 3, 4, 67, 8]