'''对于可命名元组,Python没有创建类,我们需要自己创建一个类'''import collections'''创建一个类'''yuanzu=collections.namedtuple('y',['x','y','z'])o=yuanzu(1,2,4)print(o.x)可命名元组相对简单