Google News
logo
Python Program to Get the length of a Tuple
To get the length of a tuple in Python, you can use the `len()` function. Here's an example program that demonstrates this :
Program :
# create a tuple
my_tuple = (1, 2, 3, 4, 5)

# get the length of the tuple
tuple_length = len(my_tuple)

# print the length of the tuple
print("The length of the tuple is:", tuple_length)
Output :
The length of the tuple is: 5