property函数
摘要:__metaclass__=type class Rectangle: def __init__(self): self.width=0 self.height=0 def setSize(self,size): self.width,self.height=size def getSize(sel
阅读全文
posted @
2016-04-11 15:44
菜菜菜鸟的it路
阅读(290)
推荐(0) 编辑
python 基本的序列和映射规则
摘要:>>> def checkIndex(key):... if not isinstance(key,(int,long)):raise TypeError... if key<0:raise IndexError...>>> class ArithneticSequence:... def __in
阅读全文
posted @
2016-04-07 14:09
菜菜菜鸟的it路
阅读(767)
推荐(0) 编辑
python 函数部分
摘要:#初始化 def init(data): data['first']={} data['middle']={} data['last']={} #查看条件 def lookup(data,label,name): return data[label].get(name) def store(data
阅读全文
posted @
2016-04-07 10:43
菜菜菜鸟的it路
阅读(948)
推荐(1) 编辑
python-文件操作
摘要:虫师博客链接 http://www.cnblogs.com/fnng/archive/2013/05/22/3091982.html
阅读全文
posted @
2016-03-31 10:39
菜菜菜鸟的it路
阅读(134)
推荐(0) 编辑
python 第三章 字符串-例1
摘要:1.字段宽度和精度 >>>'%.*s' % (10,'Gruido') ' Guido' >>>'%.-*s' % (10,'Gruido') 'Guido ' 详见例子 width = input('Please enter width:')price_width=10item_width=wid
阅读全文
posted @
2016-03-28 09:56
菜菜菜鸟的it路
阅读(168)
推荐(0) 编辑
第一章,重点总结
摘要:1.长整数:>>>100000000000L,否则报错 2.获取用户输入:input(“input your string:”),raw_input(“input your string:”) 3.函数:绝对值:>>>abs(-10);输出10,四舍五入:>>>round(1.0/2.0);输出1.
阅读全文
posted @
2016-03-24 11:31
菜菜菜鸟的it路
阅读(131)
推荐(0) 编辑