def predicate(x): nonlocal invoked invoked += 1 if invoked == 3: raise Exception(ex) return is_prime(x)
def predicate(x, index): nonlocal invoked invoked += 1 if x == 8: d.dispose() return is_prime(x + index * 10)
def predicate(x, index): nonlocal invoked invoked += 1 if x > 5: raise Exception(ex) return is_prime(x + index * 10)
def test_is_prime(): assert is_prime(1) == False assert is_prime(2) == True assert is_prime(3) == True assert is_prime(4) == False assert is_prime(5) == True assert is_prime(6) == False
def test_is_prime(): assert not is_prime(1) assert is_prime(2) assert is_prime(3) assert not is_prime(4) assert is_prime(5) assert not is_prime(6)
def predicate(x): invoked[0] += 1 return is_prime(x)
def predicate(x, index): invoked[0] += 1 if x == 8: d.dispose() return is_prime(x + index * 10)
def predicate(x, index): invoked[0] += 1 if x > 5: raise Exception(ex) return is_prime(x + index * 10)
def predicate(x, index): invoked[0] += 1 return is_prime(x + index * 10)
def predicate(x): invoked[0] += 1 if x == 8: d.dispose() return is_prime(x)
def predicate(x): nonlocal invoked invoked += 1 return is_prime(x)
def predicate(x, index): nonlocal invoked invoked += 1 return is_prime(x + index * 10)
def predicate(x): invoked[0] += 1 if invoked[0] == 3: raise Exception(ex) return is_prime(x)