[Tutor] A string-manipulation question

HouseScript at comcast.net HouseScript at comcast.net
Fri Mar 30 17:41:19 CEST 2007

Alan Gilfoy wrote:

> Is there a way in Python to separate a string into its component words.

you could do something like this:

>>> x = Is there a way in Python to seperate a string into its compontent words.
>>> x.split()

that would yield:

['Is', 'there', 'a', 'way', 'in', 'Python', 'to', 'separate', 'a', 'string', 'into', 'its', 'component', 'words.']

As far as teh translating to pig latin.....well I honestly don't know.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070330/0dfd2b79/attachment.html 

More information about the Tutor mailing list