Getting a number out of a string

Claudio Grondi claudio.grondi at freenet.de
Tue Sep 27 16:28:53 EDT 2005


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

Claudio

<ssmith579 at aol.com> schrieb im Newsbeitrag
news:1127844971.471405.172860 at g47g2000cwa.googlegroups.com...
> I'm trying to extract single digit number from a string.
>
> t[1] = '06897'
>
> I want to get the 7, 9,8 & 6 seperated out to use but can't find a way
> to split out the single characters.
>
> Thanks
>





More information about the Python-list mailing list