摘要:
collections模块:python中的扩展数据类型 namedtuple:命名元组 Point = namedtuple("point", ["x", "y"]) p1 = Point(1, 2) ->得到 point(x=1, y=2) print(p1) ->得到 1 print(p1.y 阅读全文
posted @ 2018-11-11 16:02
Qimisun
阅读(140)
评论(0)
推荐(0)
摘要:
collections模块 在内置数据类型(dict、list、set、tuple)的基础上,collections模块还提供了几个额外的数据类型:Counter、deque、defaultdict、namedtuple和OrderedDict等。 1.namedtuple: 生成可以使用名字来访问 阅读全文
posted @ 2018-11-11 14:17
Qimisun
阅读(146)
评论(0)
推荐(0)

浙公网安备 33010602011771号