![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 78
cjh3353
这个作者很懒,什么都没留下…
展开
-
python中单继承和多继承中子类默认继承父类的哪个构造函数__init__
单继承情况 (1)子类默认无__init__时,则会直接继承父类__init__ #!/usr/bin/env python #coding=utf-8 class BaseClass: """docstring for BaseClass""" def __init__(self): self.name = 'cjh' print 'BaseClass: Construct原创 2015-08-11 20:59:08 · 4247 阅读 · 0 评论 -
python中str(字符串)、list(列表)、tuple(元组)、dict(字典)相互转化关系及字典键-值遍历
python中str(字符串)、list(列表)、tuple(元组)、dict(字典)相互转化关系及字典键-值遍历 #!/usr/bin/env python #coding=utf-8 def main(): strs = "this is a cjh's str" lst = ['this', 'is', 'a', "cjh's", 'list'] tpl = ('this'原创 2015-08-27 22:42:17 · 4132 阅读 · 0 评论 -
python中set(可变集合)、frozenset(不可变集合)的基本操作
python中set(可变集合)、frozenset(不可变集合)的基本操作 #!/usr/bin/env python #coding=utf-8 def main(): #可变集合 print ">>>>>>>>>>>>>>>>Set" sets1 = set("this is a print's set1") sets2 = set("this is a wsy's se原创 2015-08-28 12:39:19 · 20732 阅读 · 0 评论