diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2025-02-06 12:09:43 +0000 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2025-02-06 12:09:43 +0000 |
commit | 3af9b11229f79d3e6347a2e628772a729c644016 (patch) | |
tree | 03beec1fc9e2de5d79b196bc46fb5b9056f8b1c6 /comp/work/43 | |
parent | 02653ab40d93fb7e6d07edb747fe0e07c5d60c74 (diff) |
did some interesting work
Diffstat (limited to 'comp/work/43')
-rw-r--r-- | comp/work/43/photo.png | bin | 0 -> 18115 bytes | |||
-rw-r--r-- | comp/work/43/q1.py | 38 |
2 files changed, 38 insertions, 0 deletions
diff --git a/comp/work/43/photo.png b/comp/work/43/photo.png Binary files differnew file mode 100644 index 0000000..5786a78 --- /dev/null +++ b/comp/work/43/photo.png 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)) |