Python tuple() Function
Example
Create a tuple containing fruit names:
x = tuple(('apple', 'banana', 'cherry'))
Definition and Usage
The tuple() function creates a tuple object.
Note:You cannot change or delete items from a tuple.
Learn more about collections in the 'Python Tuple' chapter.
Syntax
tuple(iterable)
Parameter Value
Parameter | Description |
---|---|
iterable | Required. A sequence, set, or iterable object. |