SyntaxFix
Write A Post
Hire A Developer
Questions
Did you try with strip() :
listOfNum = ['231512-n','1209123100000-n00000','alphanumeric0000', 'alphanumeric'] print [item.strip('0') for item in listOfNum] >>> ['231512-n', '1209123100000-n', 'alphanumeric', 'alphanumeric']