摘要: mydict.py代码如下: 编写mydict_test.py如下: 阅读全文
posted @ 2017-12-22 15:02 魂~ 阅读(517) 评论(0) 推荐(0) 编辑
摘要: 链接BaseException +-- SystemExit +-- KeyboardInterrupt +-- GeneratorExit +-- Exception +-- StopIteration +-- StopAsyncIteration +-- ArithmeticError | +- 阅读全文
posted @ 2017-12-22 11:43 魂~ 阅读(201) 评论(0) 推荐(0) 编辑
摘要: from enum import Enum Month = Enum('Month', ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')) for name, member in Month.__members__.items(... 阅读全文
posted @ 2017-12-22 11:34 魂~ 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 一、容器 容器是一种把多个元素组织在一起的数据结构,容器中的元素可以逐个地迭代获取,可以用in, not in关键字判断元素是否包含在容器中。通常这类数据结构把所有的元素存储在内存中。 二、可迭代对象Iterable和迭代器Iterator 我们在用for ... in ...语句循环时,in后面跟 阅读全文
posted @ 2017-12-22 11:18 魂~ 阅读(288) 评论(0) 推荐(0) 编辑