Python List count() method

The list.count() method returns the number of times x appears in the list.

Syntax

Parameter

x: This parameter represents the value to search for and can contain any iterable (list, set, tuple, etc.)

Return

This method returns the number of times the specified element appears in the list.

Example 1

Output

Example 2

Output

Pin It on Pinterest

Share This