goalie.has_duplicates

goalie.has_duplicates(x: Iterable[Hashable]) bool

Check whether the input has duplicate elements.

Parameters:

x (iterable of hashable) – Values to check.

Returns:

True if any element appears more than once.

Return type:

bool

Examples

>>> has_duplicates(["a", "a"])
True
>>> has_duplicates(["a", "b"])
False