Here is my code. I\'m not exactly sure if I need a counter for this to work. The answer should be \'iiii\'
.
def eliminate_consonants(x):
You can try pythonic way like this,
In [1]: s = 'mississippi'
In [3]: [char for char in s if char in 'aeiou']
Out[3]: ['i', 'i', 'i', 'i']
Function;
In [4]: def eliminate_consonants(x):
...: return ''.join(char for char in x if char in 'aeiou')
...:
In [5]: print(eliminate_consonants('mississippi'))
iiii