kumar s wrote: >Thank you. > But I messed up my question. >s = " I am learning python " >f = s.strip() >f >'I am learning python' > >How can I get the ouput to: > >'Iamlearningpython'. > > > How about this s=" I am Learning Python " s="".join([x.strip() for x in s.split(' ')]) print s IamLearningPython