Anti_vowel


#1



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 "H" when it should return "Hy lk Wrds!".

can someone please review my code. the loop doesnt seem to go through each element in the string.

Replace this line with your code. 
def anti_vowel(text):
    word = ""
    for i in range(0 , len(text)-1):
        if text[i] not in "aeiouAEIOU":
            word = word + text[i]
        else:
            word = text
        return word
w = raw_input("enter a word")
print anti_vowel(w)


#2

Hello @tagrockstar60746,

The first time the for loop iterates, it immediately returns the world. Maybe try returning the word outside the for loop...


#3

try this: (indent return word)

def anti_vowel(text):
word = ""
for i in range(0 , len(text)):
if text[i] not in "aeiouAEIOU":
word = word + text[i]
return word
w = raw_input("enter a word: ")
print anti_vowel(w)


#4

sorry, didnt get the formatting right but anyway:

change this
line 3- length text (not text-1)
line 8- remove 1 indent (same as 'for')

tht shld d t !!