I need to scan a long string to determine numbers and put commas after every number. But digits are not the same and randomly changes.
little sample = 14 194 180 119 195 213 175 220 133 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 72 288 319 345 275 145 5
Here is what I tried so far
for i in range(len(my_values)):
if my_values[i] in (range(999)):
my_values[i] = ","
But It gave me strange output
['0', '\t', '0', '\t', '0', '\t', '0', '\t', '0', '\t', '1', '2', '5', '\t', '2', '7', '1', '\t', '3', '0', '8', '\t',
Note: isdigit or isNumeric functions are valid for one character. They did not work. What should I change to add commas on string after randomly changes number?
",".join(my_values.split())