From 3af9b11229f79d3e6347a2e628772a729c644016 Mon Sep 17 00:00:00 2001 From: thing1 Date: Thu, 6 Feb 2025 12:09:43 +0000 Subject: did some interesting work --- comp/work/43/photo.png | Bin 0 -> 18115 bytes comp/work/43/q1.py | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 comp/work/43/photo.png create mode 100644 comp/work/43/q1.py (limited to 'comp/work/43') diff --git a/comp/work/43/photo.png b/comp/work/43/photo.png new file mode 100644 index 0000000..5786a78 Binary files /dev/null and b/comp/work/43/photo.png differ 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)) -- cgit v1.2.3