# coding:utf-8
from collections import namedtuple
Student = namedtuple(‘Student‘, [‘no‘, ‘name‘, ‘age‘, ‘sex‘])
student = Student("2016214338", u"张三", 19, u"男")
print student.name
print student.age
-----结果显示--------------------
张三
19
时间: 2025-01-14 08:36:16