aboutsummaryrefslogtreecommitdiff
path: root/challenge-254/zapwai/python/ch-2.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-254/zapwai/python/ch-2.py')
-rw-r--r--challenge-254/zapwai/python/ch-2.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/challenge-254/zapwai/python/ch-2.py b/challenge-254/zapwai/python/ch-2.py
new file mode 100644
index 0000000000..084bb33383
--- /dev/null
+++ b/challenge-254/zapwai/python/ch-2.py
@@ -0,0 +1,23 @@
+def proc(s):
+ vow = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
+ stash = []
+ print("Input:", s)
+ for c in s:
+ if c in vow:
+ stash.append(c)
+ print("Output: ", end='')
+ for c in s:
+ if c in vow:
+ print(stash.pop(), end='')
+ else:
+ print(c, end='')
+ print()
+
+s = "Raku"
+proc(s)
+s = "Perl"
+proc(s)
+s = "Julia"
+proc(s)
+s = "Uiua"
+proc(s)