[Tutor] Comment

Gerard Blais gerard.blais at gmail.com
Sat Aug 24 10:34:22 EDT 2019


you can enclose a """" literal inside a pair of triple single quotes.

,,,
comment with embedded """
''''

and vice versa.

On Fri, Aug 23, 2019, 19:14 Cameron Simpson <cs at cskk.id.au> wrote:

> On 23Aug2019 22:36, Olsen, Avalow Y <Yuanyuan.A.Olsen at HealthPartners.Com>
> wrote:
> >Is there a mechanism to comment out large blocks of Python code? So
> >far, the only ways I can see of commenting out code are to either start
> >every line with a #, or to enclose the code in triple quotes.
>
> I sometimes put the code in an "if False:" statement.
>
> There isn't a multiline comment syntax, so you need to either comment
> out individual lines or use a multiple contruct (eg the "if" statement)
> or your suggestion of the triple quoted string (though that breaks as
> soon as the enclosed code itself has such a string).
>
> Cheers,
> Cameron Simpson <cs at cskk.id.au>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list