def disemvowel(string):
vowels = ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U')
listString = list(string)
for t in listString:
if t in vowels:
listString.remove(t)
string = ''.join(listString)
return string
The function is supposed to remove all the vowels and if the input is:
'This website is for losers LOL!'
The correct output should be:
'Ths wbst s fr lsrs LL!'
But the moment I changed the input to have vowels appear consecutively with each other i.e.
'This websitea is for loosers LOL!'
The output becomes
'Ths wbsta s fr losrs LL!'
which is incorrect (see 'wbsta'
and 'losrs'
).