Collection Methods

collections.deque.count()

Count items equal to the specified value.

Formal Syntax & Structure

python syntaxpython
deque_instance.count(x, /)

Parameters & Attributes

NameTypeDescription
xobjectValue to append, remove, search for or insert.

Return Value

int

The int result described above.

Working Example

Example Snippetpython
import collectionsd=collections.deque([1,2,1])print(d.count(1))
Python Reference