Splitting of string at an interval

Chris Angelico rosuav at gmail.com
Sun Apr 7 23:01:57 EDT 2013


On Mon, Apr 8, 2013 at 7:48 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Like every programming problem, the solution is to break it apart into
> small, simple steps that even a computer can follow.
> ...

5) Shortcut the whole thing, since the problem was underspecified, by
using a literal.

words = ["The Sun", "rises in", "in the", "east of", "our earth"]

*dive for cover against rotten tomatoes*

ChrisA



More information about the Python-list mailing list