Welcome to the Treehouse Community
Looking to learn something new?
Jason Smith7,439 Points
can anyone see the syntax error i made?
i can't find it for the life of me! it says it's on line 6, but i don't see a problem there.
def disemvowel(word): word = [word] for vowel in word: while vowel == 'a' or 'e' or 'i' or 'o' or 'u' or 'A' or 'E' or 'I' or 'O' or 'U': word.remove(vowel) except ValueError: break return (word)
Alex KoumparosPython Development Techdegree Student 36,862 Points
The particular error that you are running into on line 6 is that you are using an
except without a corresponding
You do have a couple of other issues with your code:
- you need to return a string but you are returning a list;
- you're using a while loop on
vowelbut you only look at that character once, so you would be better to use an if
- you're using a for loop to iterate through the same iterable that you are removing items from.
Hope that points you in the right direction