by W0lf · 5y ago · 0 comments
def is_prime(n): return not True in [n%x == 0 for x in range(2, n/2)]
even better you only need to test the primes <= floor(sqrt(n))