From 8db85cd488ebedbbda40cca5403676ce0ed8e072 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 22 Jan 2024 18:45:40 +0000 Subject: - Added solutions by Eric Cheung. - Added solutions by Laurent Rosenfeld. - Added solutions by Mark Anderson. - Added solutions by Niels van Dijke. - Added solutions by PokGoPun. - Added solutions by Luca Ferrari. - Added solutions by David Ferrone. - Added solutions by W. Luis Mochan. --- challenge-253/eric-cheung/python/ch-1.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 challenge-253/eric-cheung/python/ch-1.py (limited to 'challenge-253/eric-cheung/python/ch-1.py') 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])) -- cgit