I'm looking for converting a list of strings separated by comma to a single element like so:
my_list=['A','B','B','C','C','A']
I want the output to be:
my_list=['ABBCCA']
I'm looking for converting a list of strings separated by comma to a single element like so:
my_list=['A','B','B','C','C','A']
I want the output to be:
my_list=['ABBCCA']
you can concat str by join
:
my_list = ['A', 'B', 'B', 'C', 'C', 'A']
print(''.join(my_list)) # 'ABBCCA'
if you mean split comma in one string, like:
s = 'A,B,B,C,C,A'
print(''.join(s.split(','))) # 'ABBCCA'