# 10 examples of 'sum of prime numbers from m to n in python' in Python

Every line of 'sum of prime numbers from m to n in python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

## All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
``3def is_prime(n):4    i = 35    while i * i <= n:6        if n % i == 0: return False7        i += 28    return True``
``1def is_prime(n):2	if n < 2:3		return False45	i = 267	while i * i <= n:8		if n % i == 0:9			return False1011		i += 11213	return True``
``6def is_prime(n):7   '''8   checks if a number is prime9   '''10   if n < 2:11      return False12   if n == 2:13      return True14   for x in range(2, int(n**0.5)+1, 2):15      if n % x == 0:16         return False17   return True``
``23def isPrime(n):24    return not any(x for x in range(2, int(sqrt(n)) + 1) if n % x == 0)``
``3def is_prime(n):4    if n <= 1:5        return False6    elif n == 2:7        return True8    elif n % 2 == 0:9        return False10    for i in xrange(3, int(sqrt(n))+1, 2):11        if n % i == 0:12            return False13    return True``
``21def is_prime(n):22    for i in xrange(2, int(sqrt(n)) + 1):23        if n % i == 0:24            return False2526    return True``
``18def gcd(m, n):19    while m != 0:20        m, n = n % m, m21    return n``
``746def prime_number_factorisation(n):747    if n < 2:748        return [n]749    i = 2750    factors = []751    while i * i <= n:752        if n % i:753            i += 1754        else:755            n //= i756            factors.append(i)757    if n > 1:758        factors.append(n)759    return factors``
``12def isprime(n):13    n = int(n)14    return n > 1 and all(n%i for i in islice(count(2), int(sqrt(n)-1)))``
``45def smallest_prime_atleast(m):46    """47    Find the first prime >= m48    """49    n=m50    while not is_prime(n):51        n+=152    return n``