On Thu, Aug 23, 2012 at 3:05 PM, Jared Nielsen <nielsen.ja...@gmail.com> wrote:
> Hi all,
> I'm new to programming and Python.
> I want to write a script that takes a string input and breaks the string at
> keywords then outputs the pieces on separate lines.

This is just for printing? You can use replace():

>>> text = "Ham and cheese omelette with hasbrowns and coffee."
>>> print text.replace(" and ", "\nand\n")
Ham
and
cheese omelette with hasbrowns
and
coffee.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to