Google News
logo
Python Program to Using the tuple() constructor to create a Tuple
In the following example of Python program that uses the `tuple()` constructor to create a tuple :
Program :
# create a tuple using the tuple() constructor
my_tuple = tuple([1, 2, 3, 4, 5])

# print the tuple
print(my_tuple)
Output :
(1, 2, 3, 4, 5)
In the above program, we first create a list `[1, 2, 3, 4, 5]` and then pass it to the `tuple()` constructor to create a tuple.

We then print the tuple using the `print()` function.