diff options
Diffstat (limited to 'challenge-198/eric-cheung/python/ch-2.py')
| -rwxr-xr-x | challenge-198/eric-cheung/python/ch-2.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/challenge-198/eric-cheung/python/ch-2.py b/challenge-198/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..315da4e457 --- /dev/null +++ b/challenge-198/eric-cheung/python/ch-2.py @@ -0,0 +1,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))
|
