You can index into a string:
>>> s = '06897'
>>> s[2]
'8'

You can also turn each character into an integer, in various ways:
>>> [int(c) for c in s]
[0, 6, 8, 9, 7]
>>> map(int, s)
[0, 6, 8, 9, 7]

Jeff

Attachment: pgpDMq5e3RucB.pgp
Description: PGP signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to