diff options
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)) |