定义和使用具名元组
创建具名元组
In [1]: from collections import namedtuple
In [2]: City = namedtuple('City', 'name country population coordinates')
In [3]: tokyo = City('Tokyo', 'JP', 36.933, (35.689722, 139.691667))
In [4]: tokyo
Out[4]: City(name='Tokyo', country='JP', population=36.933, coordinates=(35.689722, 139.691667))
单词数:39字符数:323