diff options
| author | 冯昶 <fengchang@novel-supertv.com> | 2023-10-31 11:13:53 +0800 |
|---|---|---|
| committer | 冯昶 <fengchang@novel-supertv.com> | 2023-10-31 11:13:53 +0800 |
| commit | 50b486fa26bc3ad30ed80a83f269f8dc93fd8bcd (patch) | |
| tree | 3b43cb77c4d042b62b31fd95e04caeaddc2f3bba /challenge-240/eric-cheung/python | |
| parent | 7fe999f4ae6a14b7f3497f06eaa936c6fcbe6436 (diff) | |
| parent | 71ad4139989a590a4a64b128ae3de74f7c19bad8 (diff) | |
| download | perlweeklychallenge-club-50b486fa26bc3ad30ed80a83f269f8dc93fd8bcd.tar.gz perlweeklychallenge-club-50b486fa26bc3ad30ed80a83f269f8dc93fd8bcd.tar.bz2 perlweeklychallenge-club-50b486fa26bc3ad30ed80a83f269f8dc93fd8bcd.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'challenge-240/eric-cheung/python')
| -rwxr-xr-x | challenge-240/eric-cheung/python/ch-1.py | 16 | ||||
| -rwxr-xr-x | challenge-240/eric-cheung/python/ch-2.py | 7 |
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)
|
