from math import sqrt def is_prime(n): return n > 1 and all(n % i for i in range(2, int(sqrt(n))+1))
import math- from math import sqrt
- def is_prime(n):
if n % 2 == 0 and n > 2:return Falsefor i in range(3, int(math.sqrt(n)) + 1, 2):if n % i == 0:return Falsereturn True- return n > 1 and all(n % i for i in range(2, int(sqrt(n))+1))