Intro to python Remove vowels 19/19


#1

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


#2

That line looks a little bit off.

if letter in 'aeiouAEIOU':

Aside

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


#3

https://www.codecademy.com/en/courses/python-beginner-en-kSQwt/1/11 this is the link Thanks


#4

So your code just needs a slight tweak:

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

Then,

print phrase_without_vowels

#5

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