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.

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2021-10-29
  • 2021-11-17
  • 2021-06-17
猜你喜欢
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2021-04-14
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案