summaryrefslogtreecommitdiff
path: root/comp/work/43/q1.py
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2025-02-06 12:09:43 +0000
committerthing1 <thing1@seacrossedlovers.xyz>2025-02-06 12:09:43 +0000
commit3af9b11229f79d3e6347a2e628772a729c644016 (patch)
tree03beec1fc9e2de5d79b196bc46fb5b9056f8b1c6 /comp/work/43/q1.py
parent02653ab40d93fb7e6d07edb747fe0e07c5d60c74 (diff)
did some interesting work
Diffstat (limited to 'comp/work/43/q1.py')
-rw-r--r--comp/work/43/q1.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/comp/work/43/q1.py b/comp/work/43/q1.py
new file mode 100644
index 0000000..acd5f93
--- /dev/null
+++ b/comp/work/43/q1.py
@@ -0,0 +1,38 @@
+def isvowel(char):
+ if char in "aeoiu":
+ return True;
+ return False
+
+def tolist(string):
+ list = []
+ for i in string:
+ list.append(i)
+ return list
+
+def stripvowels(string):
+ out = ""
+ vowels = ""
+ for i in string:
+ if isvowel(i):
+ out += "."
+ vowels += i
+ else:
+ out += i
+
+ vowels = tolist(reversed(vowels))
+ return out, vowels
+
+def swap(string, vowels):
+ final = ""
+ for i in string:
+ if i == ".":
+ final += vowels.pop(0)
+ else:
+ final += i
+ return final
+
+
+string = input("input a string: ")
+
+string, vowels = stripvowels(string)
+print(swap(string, vowels))