标签:
‘‘‘对于可命名元组,Python没有创建类,我们需要自己创建一个类‘‘‘import collections‘‘‘创建一个类‘‘‘yuanzu=collections.namedtuple(‘y‘,[‘x‘,‘y‘,‘z‘])o=yuanzu(1,2,4)print(o.x)可命名元组相对简单
可命名元组
原文地址:http://www.cnblogs.com/xwl65/p/5186150.html