[Solved] How to separate string and integers to a list [closed]


res = []
for item in s.split(' '):
...     try:
...         int(item)
...         res.append(item)
...     except:
...         res += list(item)

5

solved How to separate string and integers to a list [closed]