首页 > 其他 > 详细

tuple 可更改的列表和不可更改的元组

时间:2016-12-14 18:19:53      阅读:212      评论:0      收藏:0      [点我收藏+]

tuple([iterable])

Return a tuple whose items are the same and in the same order as iterable‘s items. iterable may be a sequence, a container that supports iteration, or an iterator object. If iterable is already a tuple, it is returned unchanged. For instance, tuple(‘abc‘) returns (‘a‘, ‘b‘, ‘c‘) and tuple([1, 2, 3]) returns (1, 2, 3). If no argument is given, returns a new empty tuple, ().

tuple is an immutable sequence type, as documented in Sequence Types — str, unicode, list, tuple, bytearray, buffer, xrange. For other containers see the built in dict, list, and set classes, and the collections module.

tuple 可更改的列表和不可更改的元组

原文:http://www.cnblogs.com/alfredsun/p/6180339.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!