Hi all, can I get your advice please (seems like many people have problems with this, and my method is quite different).
I receive an error "string index out of range" error when I run it
What I'm trying to do is to loop through the letters of vowels and checking it against the string in the function index,... etc. and if it's a vowel, to pass, move on to the next index position.
I tried to set the bound in the 1st if statement but still the error persists.
Is what I pictured in my head correct and is this method feasible? thanks!
def anti_vowel(example): answer = "" vowels = 'aeiouAEIOU' pos = 0 for vow in vowels: if vow == example[pos] or pos >= len(example) - 1: pass else: answer += example[pos] pos += 1 return answer anti_vowel('abcdefghi')