PHP
·
发表于 5年以前
·
阅读量:8286
from collections import namedtuple
Student = namedtuple('Student', ['name', 'age', 'sex'])
s = Student('aaa',18,"male")
s2= Student(name='bbb', age=12, sex="female")
if s.name == "aaa":
pass