aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-180/eric-cheung/python/ch-1.py12
-rwxr-xr-xchallenge-180/eric-cheung/python/ch-2.py15
2 files changed, 27 insertions, 0 deletions
diff --git a/challenge-180/eric-cheung/python/ch-1.py b/challenge-180/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..72d5f1e1ca
--- /dev/null
+++ b/challenge-180/eric-cheung/python/ch-1.py
@@ -0,0 +1,12 @@
+##
+
+## strInput = "Perl Weekly Challenge" ## Example 1
+strInput = "Long Live Perl" ## Example 2
+
+for nIndex in range(0, len(strInput)):
+
+ ## print (strInput[nIndex])
+ if strInput.count(strInput[nIndex]) == 1:
+ print (nIndex)
+
+ break
diff --git a/challenge-180/eric-cheung/python/ch-2.py b/challenge-180/eric-cheung/python/ch-2.py
new file mode 100755
index 0000000000..efee01d302
--- /dev/null
+++ b/challenge-180/eric-cheung/python/ch-2.py
@@ -0,0 +1,15 @@
+##
+
+import numpy as np
+
+## Example 1
+## arrList = np.array([1, 4, 2, 3, 5])
+## nVal = 3
+
+## Example 2
+arrList = np.array([9, 0, 6, 2, 3, 8, 5])
+nVal = 4
+
+nIndxArr = np.where(arrList > nVal)
+
+print (arrList[nIndxArr])