[Tutor] Split a string into characters

Hans Dushanthakumar Hans.Dushanthakumar at navman.com
Tue Aug 23 05:47:57 CEST 2005

Bingo :)

Thanks Rick

-----Original Message-----
From: tutor-bounces at python.org [mailto:tutor-bounces at python.org] On
Behalf Of Rick Pasotto
Sent: Tuesday, 23 August 2005 1:55 p.m.
To: tutor at python.org
Subject: Re: [Tutor] Split a string into characters

On Tue, Aug 23, 2005 at 01:18:43PM +1200, Hans Dushanthakumar wrote:
> Hi,
>    A quick one...
>    How do I split a string like "Hans" into a list of characters 
> ['H','a','n','s']?
> Note that there are no spaces in the original string.
>    Str.split() without any arguments looks for whitespace as splitting

> character. So, this doesn't serve the purpose.
> And str.split("") appears to be illegal.


"History will be kind to me, for I intend to write it."
		-- Winston Churchill
    Rick Pasotto    rick at niof.net    http://www.niof.net
Tutor maillist  -  Tutor at python.org

More information about the Tutor mailing list