摘要: 1、空class,占空间1 class Animal(object):2 pass 2、定义__init__()空1 class Animal(object):2 def __init__():3 pass 3、declare nameclass Animal... 阅读全文
posted @ 2014-11-20 21:19 andrew.elec90 阅读(196) 评论(0) 推荐(0) 编辑
摘要: python中使用二进制也很方便 1、表示1 one = 0b12 two = 0b103 three = 0b11 2、操作1 print 5 >> 4 # Right Shift2 print 5 << 1 # Left Shift3 print 8 & 5 # Bitwise ... 阅读全文
posted @ 2014-11-20 17:59 andrew.elec90 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1、item1 my_dict ={'a':1,'b':2}2 print my_dict.items()3 4 [('a', 1), ('b', 2)] 2、keys,values1 my_dict ={'a':1,'b':2}2 print my_dict.keys()3 print my... 阅读全文
posted @ 2014-11-20 17:30 andrew.elec90 阅读(118) 评论(0) 推荐(0) 编辑