[Head First Python]2. python of comment

1- 多行注释 ''' ''' 或 """ """

'''this is the standard way to include a

  multiple-line comment in you code'''

"""this is the standard way to include a

  multiple-line comment in you code"""

2- 单行注释 #

# this is comment

3- 中文注释

1 #_*_ coding:utf-8 _*_
2 import nester
3 cast = ["hello","kitty",["world",["Jerry"]],"program",["Java","C"],"test"]
4 nester.print_lol(cast, True) #中文注释

中文注释文件第一行需要写入代码,告知python使用的编码方式

#_*_ coding:utf-8 _*_

reference:

http://15975604853.blog.163.com/blog/static/1182880352012116574235/

原文地址:https://www.cnblogs.com/galoishelley/p/3791261.html