aboutsummaryrefslogtreecommitdiff
path: root/challenge-240/eric-cheung/python
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-240/eric-cheung/python')
-rwxr-xr-xchallenge-240/eric-cheung/python/ch-1.py16
-rwxr-xr-xchallenge-240/eric-cheung/python/ch-2.py7
2 files changed, 23 insertions, 0 deletions
diff --git a/challenge-240/eric-cheung/python/ch-1.py b/challenge-240/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..0cc518455d
--- /dev/null
+++ b/challenge-240/eric-cheung/python/ch-1.py
@@ -0,0 +1,16 @@
+
+## Example 1
+## arrStrInput = ["Perl", "Python", "Pascal"]
+## strCheck = "ppp"
+
+
+## Example 2
+## arrStrInput = ["Perl", "Raku"]
+## strCheck = "rp"
+
+
+## Example 3
+arrStrInput = ["Oracle", "Awk", "C"]
+strCheck = "oac"
+
+print ("".join([strLoop[0].lower() for strLoop in arrStrInput]) == strCheck)
diff --git a/challenge-240/eric-cheung/python/ch-2.py b/challenge-240/eric-cheung/python/ch-2.py
new file mode 100755
index 0000000000..409146c3f4
--- /dev/null
+++ b/challenge-240/eric-cheung/python/ch-2.py
@@ -0,0 +1,7 @@
+
+## arrInput = [0, 2, 1, 5, 3, 4] ## Example 1
+arrInput = [5, 0, 1, 2, 3, 4] ## Example 2
+
+arrOutput = [arrInput[arrInput[nIndx]] for nIndx in range(len(arrInput))]
+
+print (arrOutput)