GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — algorithms/string/reverse_vowel.py at master · vspriya05/algorithms Expand file tree/ Copy pathreverse_vowel.pyMore file actions 17 lines (15 loc) · 368 Bytes / Copy pathreverse_vowel.pyFile metadata and controls17 lines (15 loc) · 368 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 def reverse_vowel(s): vowels = "AEIOUaeiou" i, j = 0, len(s)-1 s = list(s) while i < j: while i < j and s[i] not in vowels: i += 1 while i < j and s[j] not in vowels: j -= 1 s[i], s[j] = s[j], s[i] i, j = i + 1, j - 1 return "".join(s) test = "hello" print(test) print(reverse_vowel(test)) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |