码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-12-14 18:21:10      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:data   scn   list   range   nal   option   for   元组   set   

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 可更改的列表和不可更改的元组

标签:data   scn   list   range   nal   option   for   元组   set   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!