def is_almost_prime(x, limit): if x <0: return False else: for y in range(2, limit+1): if(x % y == 0): return False reutrn True