Python核心编程笔记----注释

python 中注释有两种

第一种,文档注释

第二种,一般的注释

下面是例子:

class MyClass:
  '这个是文档注释'
  def __repr__(self):
    return "repr";
  def __str__(self):
    return "str";

------------------------------------------

#‘#’是一般的注释
# 测试print 时调用的函数!

a = MyClass();
print "print a :",;
print a;

原文地址:https://www.cnblogs.com/JiangLe/p/4592651.html