[Tutor] How do I make Python read a string character by character?

Akash akashmahajan at gmail.com
Thu Aug 24 08:12:30 CEST 2006


On 8/24/06, Nathan Pinno <falcon3166 at hotmail.com> wrote:
> How do I make Python read a string character by character?

>>> str = 'string'
>>> for i in range(0, len(str)):
...     print str[i]
...
s
t
r
i
n
g


just take care about the indentation.

-- 
regards
akash


More information about the Tutor mailing list