Python核心编程笔记----注释
2015-06-21 23:14
633 查看
python 中注释有两种
第一种,文档注释
第二种,一般的注释
下面是例子:
class MyClass:
'这个是文档注释'
def __repr__(self):
return "repr";
def __str__(self):
return "str";
------------------------------------------
#‘#’是一般的注释
# 测试print 时调用的函数!
a = MyClass();
print "print a :",;
print a;
第一种,文档注释
第二种,一般的注释
下面是例子:
class MyClass:
'这个是文档注释'
def __repr__(self):
return "repr";
def __str__(self):
return "str";
------------------------------------------
#‘#’是一般的注释
# 测试print 时调用的函数!
a = MyClass();
print "print a :",;
print a;
相关文章推荐
- Python核心编程笔记---- input 与raw_input
- Python对象之深拷贝、浅拷贝
- Python函数非匹配参数类型传递
- Python核心编程笔记---- print@2
- Python核心编程笔记---- print
- [Leetcode.python] 002. Add Two Numbers
- 为python添加tab自动补全功能
- eclipse配置python开发插件
- Python 模块的一般处理
- Python中四种运行其他程序的方式
- scrapy爬取豆瓣读书的图书信息
- Windows下搭建Python环境
- [Leetcode.python] 001. Two Sum
- python文件操作与输入输出
- ubuntu14.04 python2.7 安装配置OpenCV3.0
- Python socket编程之构造IP首部和ICMP首部
- python一些内置函数——filter、map、reduce
- python中List添加、删除元素的几种方法
- 搭建Python环境与Python文件类型
- [Python]新手写爬虫全过程(已完成)