摘要: 命题: 伪代码 源码: 阅读全文
posted @ 2017-12-30 14:31 NiGuard 阅读(171) 评论(0) 推荐(0)
摘要: tuple类似于list 只能查询,不能修改 应用场景:读取指定配置文件,或者当看到tuple时注意不能修改。 阅读全文
posted @ 2017-12-28 20:42 NiGuard 阅读(112) 评论(0) 推荐(0)
摘要: e.g. 需要注意的是切片时“顾首不顾尾”的特点 方法总结: names.remove() #删除指定元素 names.append(“name7”) #追加 names.insert(2,"name2.5")#在指定位置添加元素 name.index("name5")#返回指定元素的位置 name 阅读全文
posted @ 2017-12-26 21:33 NiGuard 阅读(162) 评论(0) 推荐(0)
摘要: result = 值1 if 条件 else 值2 e.g. a,b,c = 1,3,5 d = a if a > b else c 结果:d = 5 阅读全文
posted @ 2017-12-26 20:20 NiGuard 阅读(129) 评论(0) 推荐(0)
摘要: 一、数字 1.1 整型 int 32位机器 范围是-2**31~2**31-1 64位机器 范围是-2**63~2**63-1 1.2 浮点型 float 类似C中的double 占8字节 64位 52位表示底数 11位表示指数。 1.3 负数 python中虚数用j表示。 e.g. -5+4j 二 阅读全文
posted @ 2017-12-25 21:08 NiGuard 阅读(132) 评论(0) 推荐(0)
摘要: A program doesn't run any faster when it is read from a ‘.pyc’ or ‘.pyo’ file than when it is read from a ‘.py’ file; the only thing that's faster abo 阅读全文
posted @ 2017-12-25 20:38 NiGuard 阅读(164) 评论(0) 推荐(0)