aboutsummaryrefslogtreecommitdiff
path: root/challenge-253/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-253/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-253/eric-cheung/python/ch-1.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-253/eric-cheung/python/ch-1.py b/challenge-253/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..ac1c18f9c5
--- /dev/null
+++ b/challenge-253/eric-cheung/python/ch-1.py
@@ -0,0 +1,14 @@
+
+## Example 1
+arrWords = ["one.two.three", "four.five", "six"]
+strSeparator = "."
+
+## Example 2
+## arrWords = ["$perl$$", "$$raku$"]
+## strSeparator = "$"
+
+arrOutput = []
+for strLoop in arrWords:
+ arrOutput = arrOutput + strLoop.split(strSeparator)
+
+print (",".join(["\"" + strLoop + "\"" for strLoop in arrOutput if strLoop]))