aboutsummaryrefslogtreecommitdiff
path: root/challenge-274/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-274/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-274/eric-cheung/python/ch-1.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/challenge-274/eric-cheung/python/ch-1.py b/challenge-274/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..8c26012d10
--- /dev/null
+++ b/challenge-274/eric-cheung/python/ch-1.py
@@ -0,0 +1,17 @@
+
+## strSentence = "I love Perl" ## Example 1
+## strSentence = "Perl and Raku are friends" ## Example 2
+strSentence = "The Weekly Challenge" ## Example 3
+
+arrVowel = ["a", "e", "i", "o", "u"]
+
+strOutput = ""
+arrOutput = []
+
+for nIndx, strLoop in enumerate(strSentence.split()):
+
+ strOutput = (strLoop if strLoop[0].lower() in arrVowel else strLoop[1:] + strLoop[0])
+ strOutput = strOutput + "ma" + "a" * (nIndx + 1)
+ arrOutput.append(strOutput)
+
+print (" ".join(arrOutput))