Intro to python Remove vowels 19/19


This is my code not sure if im in the right path please help

phrase_without_vowels = ""
phrase = "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
for letter in phrase:
if letter [“A”, “a”, “E”, “e”, “I”, “i”, “O”, “o”, “U”, “u”] in phrase:
phrase = phrase+phrase_without_vowels
print phrase


That line looks a little bit off.

if letter in 'aeiouAEIOU':


Please remember to include a link to the exercise else we cannot know what lesson you are on.

#3 this is the link Thanks


So your code just needs a slight tweak:

if letter not in 'aeiouAEIOU':
    phrase_without_vowels += letter


print phrase_without_vowels


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.