发布时间:2019-07-01 12:11:13编辑:auto阅读(2239)
一、单行注释
语法:#注释内容
说明:python中单行注释采用 # 开头,注释可以在语句或表达式行末
示例(文件名test.py):
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 这是单选注释
print "hello,python!";
代码截图:

运行截图:

二、多行注释
语法:
'''
注释内容
'''
或
"""
注释内容
"""
说明:python 中多行注释使用三个单引号(''')或三个双引号(""")
示例(文件名test.py):
#!/usr/bin/python
# -*- coding: UTF-8 -*-
'''
打印hello,python1!
'''
print "hello,python1!";
"""
打印hello,python2!
"""
print "hello,python2!";
代码截图:

运行截图:

上一篇: python学习_14
下一篇: python11.23
 51191
 50602
 41228
 38046
 32510
 29416
 28277
 23129
 23091
 21424
 1479°
 2194°
 1818°
 1748°
 2059°
 1810°
 2493°
 4183°
 4046°
 2889°