Function Details: count_(tuple)

Description


Returns the number of times a specified value occurs in a tuple.


Extended Description


The count() method returns the number of elements with the specified value in the tuple. It performs an equality comparison on each element. For objects, it uses the object's __eq__() method for comparison. The search is performed from left to right, and the order of occurrence doesn't matter.


Function Signature


tuple.count(value: Any) -> int

Module: tuple

Class: tuple

Parameters



Parameter List


  • value: Any

Return


Returns an integer representing the count of the specified value in the tuple.


Return Type


int

Output

Explanation

This example shows counting occurrences of values that are present and not present in the tuple.