Skip to main content

first

Return the first element in it that predicate accepts.

If ``predicate`` is None it will return the first item that's not
:const:`None`.
def first(
predicate: callable | None = null,
it: iterable = null
) - > Any | None

Return the first element in it that predicate accepts. If predicate is None it will return the first item that's not :const:None.

Parameters

NameTypeDescription
predicate`callableNone` = null
ititerable = nullThe collection of elements or promises to be evaluated and searched.

Returns

TypeDescription
`AnyNone`