for loop python documentation code example
Example: check condition over a range in python
def is_prime(candidate):
return all(
candidate % n != 0
for n in range(2, candidate)
)
def is_prime(candidate):
return all(
candidate % n != 0
for n in range(2, candidate)
)