Question: def contains_non_satisfier(obj: Union[int, list], predicate: Callable[[int], bool]) -> bool: Return whether obj contains at least one element that does *not* satisfy predicate. If obj is
def contains_non_satisfier(obj: Union[int, list], predicate: Callable[[int], bool]) -> bool: """Return whether obj contains at least one element that does *not* satisfy predicate.
If obj is an int, returns True if obj does *not* satisfy predicate (i.e. predicate(obj) is False)
>>> def p(n: int) -> bool: ... return n < 10 >>> contains_non_satisfier(5, p) False >>> contains_non_satisfier(15, p) True >>> contains_non_satisfier([5, 2, [15, 7], 9], p) True """ # TODO: Implement this function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
