To convert some iterable
to a tuple, use
this general form:
S
tuple(s)
The result will be a new tuple with the same elements as in the same order.
For general information, see Section 12, “Type Stuple: Immutable sequences”.
To create an empty tuple, omit the argument. Examples:
>>> tuple()
()
>>> tuple ( ['swallow', 'coconut'] )
('swallow', 'coconut')
>>> tuple ( 'shrubbery' )
('s', 'h', 'r', 'u', 'b', 'b', 'e', 'r', 'y')
>>> tuple ( ['singleton'] )
('singleton',)