Getting a number out of a string

Will McGugan news at NOwillmcguganSPAM.com
Tue Sep 27 20:32:35 CEST 2005


Claudio Grondi wrote:
> what about:
> 
>>>>lst = [digit for digit in '06897']
>>>>lst
> 
> ['0', '6', '8', '9', '7']

Or..

 >>> list('06897')
['0', '6', '8', '9', '7']

Will McGugan
-- 
http://www.willmcgugan.com
"".join({'*':'@','^':'.'}.get(c,0) or chr(97+(ord(c)-84)%26) for c in 
"jvyy*jvyyzpthtna^pbz")



More information about the Python-list mailing list