String function to strip the last comma
Solution 1:
Just use rstrip().
result = your_string.rstrip(',')
Solution 2:
str = 'test1,test2,test3,'
str[:-1] # 'test1,test2,test3'
Just use rstrip().
result = your_string.rstrip(',')
str = 'test1,test2,test3,'
str[:-1] # 'test1,test2,test3'