John Salerno <[email protected]> writes:
> On Jul 2, 10:02 pm, Chris Angelico <[email protected]> wrote:
>
> > > game_information = '***Chutes and Ladders***\nUp to four (4) players
> > > may play.\n'\
> > > 'There are 90 spaces on the board. '\
> > > 'The player to reach space 90 first wins.'
> >
> > I'd do this with a triple-quoted string - it'll simply go across multiple
> > lines:
> > game_information = """***Chutes and Ladders***
> > Up to four (4) players may play.
> > There are 90 spaces on the board.
> > The player to reach space 90 first wins."""
>
> Yeah, I considered that, but I just hate the way it looks when the
> line wraps around to the left margin.
import textwrap
game_information = textwrap.dedent("""\
***Chutes and Ladders***
Up to four (4) players may play.
There are 90 spaces on the board.
The player to reach space 90 first wins.
""")
--
\ “Nothing is more sacred than the facts.” —Sam Harris, _The End |
`\ of Faith_, 2004 |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list