'''对于可命名元组,Python没有创建类,我们需要自己创建一个类'''import collections'''创建一个类'''yuanzu=collections.namedtuple('y',['x','y','z'])o=yuanzu(1,2,4)print(o.x)可命名元组相对简单
posted on 2016-02-10 21:55 卷土重来 阅读(212) 评论(0) 收藏 举报