2.2 如何为每个元组命名

# 2 命名的元祖
from collections import namedtuple
Student = namedtuple('Student',['name','age','sex','email'])
s = Student('jimi',16,'role','jian@qq.com')
s.age
s.name
s.email
posted @ 2017-02-16 11:02  邹文强  阅读(134)  评论(0编辑  收藏  举报