Aug-14-2019, 01:28 PM
There is string method zfill for filling in zeros and if the objective is to have standard lenght (9) and fill shorter values with zeros and removing hyphens one can simply do:
>>> ssns = ['867-53-0909','333-22-4444','123-12-1234', '777-93-9311','123-12-1423', '1-2-3', 'Missing', '45-67-78'] >>> [''.join(ssn.split('-')).zfill(9) for ssn in ssns if ssn != 'Missing'] ['867530909', '333224444', '123121234', '777939311', '123121423', '000000123', '000456778']
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.