aboutsummaryrefslogtreecommitdiff
path: root/challenge-198/eric-cheung/python/ch-2.py
blob: 315da4e457d7e29d458e87557e7343f87813b3b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
from sympy import isprime

## nInput = 10  ## Example 1
## nInput = 15  ## Example 2
## nInput = 1  ## Example 3
nInput = 25  ## Example 4

arrPrime = [nLoop for nLoop in range(2, nInput) if isprime(nLoop)]

print (len(arrPrime))