GMPY2 es primo

gmpy2.is_prime(var)
#must have gmpy2 installed and imported
Lucas Gomes