> For the complete documentation index, see [llms.txt](https://minghuiwu.gitbook.io/tfbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://minghuiwu.gitbook.io/tfbook/fu-lu-2-gong-yu-shan-qi-shi-bi-xian-li-qi-qi-jian-ming-python-ji-chu/fu-lu-1-gong-yu-shan-qi-shi-bi-xian-li-qi-qi-jian-ming-python-ji-chu/2.7-zhu-shi.md).

# 2.7 注释

注释是写给人看的，为了方便程序的理解，可以当作是一个嵌在程序里的文档。对于计算机来说，注释会被忽略掉，不会被执行。在Python中有两种注释方法：

单行注释的话在最前面加上一个“#”就可以了。

多行注释用三个单引号或者三个双引号把需要注释的话包在其中就可以了。

![图2-19](/files/-LZoVZ91RX1AH7xE1b_t)

我们可以看到，被注释掉的语句不会被输出，而且会变成斜体。

![图2-20](/files/-LZoVP93-bvzkcatwEJe)

多行注释可以一次把中间的三条语句都注释掉，因此只输出了头尾两条语句。上图中的单引号也可以改写成双引号，但是要注意前三个引号和后三个引号的类型要一致，否则也会报错。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://minghuiwu.gitbook.io/tfbook/fu-lu-2-gong-yu-shan-qi-shi-bi-xian-li-qi-qi-jian-ming-python-ji-chu/fu-lu-1-gong-yu-shan-qi-shi-bi-xian-li-qi-qi-jian-ming-python-ji-chu/2.7-zhu-shi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
