I\'ve been presented with the task of turning a string of mixed numbers (\"1 3 5 8 10\"), for example, and my goal is to put these numbers into a list as integers.
I ha
You can use regular expressions:
import re s = "1 3 5 8 10" final_data = list(map(int, re.findall('\d+', s))) print(final_data)
Output:
[1, 3, 5, 8, 10]