tuple()Easy Examples

Creates a new immutable tuple

Basic tuple() usage

Simple demonstration of the tuple() built-in function.

python
t = tuple([1, 2, 3])
print(t)
t2 = tuple("hello")
print(t2)

tuple() is a built-in function that creates a new immutable tuple.

tuple() with different inputs

Calling tuple() with various argument types.

python
# More tuple() examples
print("tuple() is a Python built-in function")
print(f"Type: {type(tuple)}")

tuple() accepts different types of arguments and produces corresponding results.

Want to try these examples interactively?

Open Easy Playground