[Tutor] avoid split function

kumar s ps_python at yahoo.com
Fri Aug 13 01:25:06 CEST 2004

Dear group, 
 I am a newbie to Python. I am grinding my abilities
in list datatypes  and fuctions. 

I am trying to avoid .split() function to process a

My programs follows: 

m = []
y = []

a = "This is a test"

for i in range(0,len(a)):
     if a[i] == "  ":
           print y
     elif a[i] != "  ":

I wanted to push "This" in to m as m = ['This']

I know i can do this using:

c = a.split()

I just wanted to avoid using split and make it work.
The output I always get is y =

I created m because I wanted to push each element of
y(y = ['T','h','i','s']) to m to make it ['This'].

Can any one help me please suggest some tricks of how
I could do that.

Thank you.


Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

More information about the Tutor mailing list