What is going on in this code (Python 2.7)? : <pre><code>import math
def is_prime(n):
    if n % 2 == 0 and n &gt; 2: 
        return False
    return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))
</code></pre>

<p>I received an assignment where I had to find the sum of all prime numbers up to 2 million and the code I wrote originally took way too long to run so the teacher gave me this algorithm to check if the number is prime. However, I don't quite seem to get what's going on in the return all statement and what it has to do with prime numbers</p>
