Python不会在注释中使用三引号。注释使用井号(又称井号):
# this is a comment
三引号是一个文档字符串,与注释不同,它实际上可以作为程序的真实字符串使用:
>>> def bla():... """Print the answer"""... print 42...>>> bla.__doc__'Print the answer'>>> help(bla)Help on function bla in module __main__:bla() Print the answer
只要是字符串,就不严格要求使用三引号。使用
"""只是一个惯例(并且具有多行的优势)。



