i can't able delete comma below list of strings
[',156,151,2016-06-07',',160,147,2016-03-16',',99,91,2016-06-11']
i tried use join , delete didn't work
expecting result below
['156,151,2016-06-07','160,147,2016-03-16','99,91,2016-06-11']
please me...thanks in advance
you can use list-comprehension:
>>> l = [',156,151,2016-06-07',',160,147,2016-03-16',',99,91,2016-06-11'] >>> l = [i.lstrip(',') in l] >>> l ['156,151,2016-06-07', '160,147,2016-03-16', '99,91,2016-06-11']
Comments
Post a Comment