UniCoreFW

some()

Check if at least one element in the array matches the predicate.

Implementation

Args: array: The array to check func: A predicate function Returns: True if any element matches, False otherwise

Example

some([1, 2, 3], lambda x: x > 0)

Expected output: True

Source Code

def some(array: List[T], func: Callable[[T], bool]) -> bool: return any(func(x) for x in array)