ReferenceBuilt-in functions
tuple()
An ordered sequence that cannot be changed.
Signature
tuple(iterable=())Parameters
| Name | Means |
|---|---|
iterable | what to copy from |
Returns
A new tuple.
Example
Python
print(tuple([1, 2]))
print(tuple("ab"))
print(type((5,)).__name__, type((5)).__name__)Output
(1, 2)
('a', 'b')
tuple int