dotnet-learn-vs/WebMVC/WebMVCApi/md/Python3 注释.md
2023-05-12 23:19:15 +08:00

45 lines
878 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
icon: edit
date: 2021-09-20
category:
- python
tag:
- python
- 注释
headerDepth: 5
---
# Python3 注释
# Python3 注释
确保对模块, 函数, 方法和行内注释使用正确的风格
Python中的注释有单行注释和多行注释
Python中单行注释以 # 开头,例如::
```python
# 这是一个注释
print("Hello, World!")
```
多行注释用三个单引号 ''' 或者三个双引号 """ 将注释括起来,例如:
## 1、单引号'''
```python
#!/usr/bin/python3
'''
这是多行注释,用三个单引号
这是多行注释,用三个单引号
这是多行注释,用三个单引号
'''
print("Hello, World!")
```
## 2、双引号"""
```python
#!/usr/bin/python3
"""
这是多行注释,用三个双引号
这是多行注释,用三个双引号
这是多行注释,用三个双引号
"""
print("Hello, World!")
```