split number from string python code example
Example 1: split numbers python
num = 12345
>>> [int(i) for i in str(num)]
[1, 2, 3, 4, 5]
Example 2: split string with first numerical value in python
re.split(r'(^[^\d]+)', string)[1:]
num = 12345
>>> [int(i) for i in str(num)]
[1, 2, 3, 4, 5]
re.split(r'(^[^\d]+)', string)[1:]