I am forced to use comma separation in one of my input arguments to separate multiple values. So I end up with
my_string = ['a,b,c']
How can I convert this so that
my_new_string = ['a', 'b', 'c']
I am forced to use comma separation in one of my input arguments to separate multiple values. So I end up with
my_string = ['a,b,c']
How can I convert this so that
my_new_string = ['a', 'b', 'c']
Try this one-liner:
my_new_string = [x for y in my_string for x in y.split(',')]