Python tuple len() Method Syntax

Syntax: len(object)

Parameters:

  • object: Any iterable like Tuple, List, etc.

Return type: the number of elements in the tuple.

Python Tuple – len() Method

While working with tuples many times we need to find the length of the tuple, and, instead of counting the number of elements with loops, we can also use Python len(). We will learn about the len() method used for tuples in Python.

Example:

Python3




Tuple =( 1, 0, 4, 2, 5, 6, 7, 5)
print(len(Tuple))


Output :

8

Similar Reads

Python tuple len() Method Syntax

...

Tuple len() in Python Examples

Syntax: len(object) Parameters: object: Any iterable like Tuple, List, etc. Return type: the number of elements in the tuple....