Python tuple() Function
Example
Create a tuple containing fruit names:
x =
tuple(('apple', 'banana', 'cherry'))
Try it Yourself »
Definition and Usage
The tuple()
function creates a tuple object.
Note: You cannot change or remove items in a tuple.
Read more about sets in the chapter Python Tuples.
Syntax
tuple(iterable)
Parameter Values
Parameter | Description |
---|---|
iterable | Optional. A sequence, collection or an iterator object |
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.