Page 98 - Beginning Programming with Pyth - John Paul Mueller
P. 98

starts and ends with three double quotes (""") or three single quotes (''') like this:
"""
Application: Comments.py
Written by: John
Purpose: Shows how to use comments.
"""
These lines aren’t executed. Python won’t display an error message when they appear in your code. However, Notebook treats them differently, as shown in Figure 4-21. Note that the actual Python comments, those preceded by a hash (#) in cell 1, don’t generate any output. The triple-quote strings, however, do generate output. If you plan to output your notebook as a report, you need to avoid using triple- quoted strings. (Some IDEs, such as IDLE, ignore the triple-quoted strings completely.)
   FIGURE 4-21: Multiline comments do work, but they also provide output.
 


























































































   96   97   98   99   100