Your code does not work since it is building 2 lists; the first one contains those which start with + or (, and the second one those which don't; these are then catenated in order.
Your code fixed and using a conditional expression properly would read
>>> sent = ['attachment', '(1.', '=', '+EDT)', 'Details'] >>> [ w[1:] if w.startswith(('(', '+')) else w for w in sent ] ['attachment', '1.', '=', 'EDT)', 'Details']
However a better and more powerful option would be to use re.sub here
>>> import re >>> sent = ['attachment', '(1.', '=', '+EDT)', 'Details'] >>> [ re.sub(r'^[+(]', '', w) for w in sent ] ['attachment', '1.', '=','EDT)', 'Details']
The regular expression ^[+(] matches the beginning of string followed by exactly 1 + or (; whatever is matched is replaced with an empty string ''.
On the other hand if you really want removing all leading ( and + characters, no matter how many, use the .lstrip:
>>> sent = ['attachment', '(1.', '=', '+EDT)', 'Details'] >>> [ w.lstrip('+(') for w in sent ] ['attachment', '1.', '=', 'EDT)', 'Details']
This will also replace +(++++((((foo with foo which might or might not be what you wanted.
str.lstrip()seems to be what you want.