# 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

 

相关文章:

  • 2021-06-13
  • 2022-02-25
  • 2022-12-23
  • 2021-06-16
  • 2021-08-13
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
猜你喜欢
  • 2021-07-12
  • 2021-08-19
  • 2022-01-08
  • 2022-12-23
  • 2021-10-22
  • 2021-09-08
相关资源
相似解决方案