[Tutor] (no subject)

Ian Witham witham.ian at gmail.com
Fri Sep 21 00:57:10 CEST 2007


On 9/21/07, david lazaro <zero2188 at hotmail.com> wrote:
>
> the book is called "Python Programming, Second Edition for the absolute
> beginner". im using the triple quotes in the beginning and end. im sending
> an attachment of what its coming out as. the actual program should say Game
> Over, but its cutting Over in half.
>
> ------------------------------
> Make your little one a shining star! Shine on!<http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
>
The backslash (\) is an escape character and should be used with care. One
option would be to escape the backslash itself by using a double backslash
(\\), but in your case the best solution would bw to put an "r" before the
first triple quote. This denotes a 'raw' string in which escape characters
are ignored.

eg.

r"""Ignore the \n escape characters in this sting"""

Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070921/d1a95c71/attachment-0001.htm 


More information about the Tutor mailing list