Reading Python - converting a string of numbers into a list of int I'm attempting to convert string '011101111111110' to an array of ints : [0,1,1,1,0,1,1,1,1,1,1,1,1,1,0]
Here is my code :
mystr = '011101111111110'
list(map(int, mystr.split('')))
But returns error :
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-54-9b0dca2f0819> in <module>()
1 mystr = '011101111111110'
----> 2 list(map(int, mystr.split('')))
ValueError: empty separator
How to split the string that has an empty splitting separator and convert result to an int array ?