I want to strip all kinds of punctuation at the start of the string using Python. My list contains strings and some of them starting with some kind of punct
You can use strip():
Return a copy of the string with the leading and trailing characters removed. The chars argument is a string specifying the set of characters to be removed.
Passing string.punctuation will remove all leading and trailing punctuation chars:
>>> import string
>>> string.punctuation
'!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
>>> l = [',,gets', 'gets,,', ',,gets,,']
>>> for item in l:
... print item.strip(string.punctuation)
...
gets
gets
gets
Or, lstrip()
if you need only leading characters removed, rstip()
- for trailing characters.
Hope that helps.