Anti_vowel


#1



I am working on the anti_vowel practice and using the code below. I don't understand where I went wrong. I would appreciate it if you could provide me any help.


https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/1/2?curriculum_id=4f89dab3d788890003000096#


Oops, try again. Your function fails on anti_vowel("Hey look Words!"). It returns "Hey look Words!" when it should return "Hy lk Wrds!".


def anti_vowel(text):
    for letter in text:
        if letter in "aeiouAEIOU":
            text.replace(letter, "")
            return text
        else:
            return text


#2

a function ends the moment a return keyword is reached, you might want to replace return outside the loop so the loop can replace all the vowels

i advise against the use of replace, learning to build your own algorithm is more important, but if you really want to use replace, you currently execute a replace action, but don't store the result of this replace action anywhere?


#3

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