8.0 Anti_vowel



Your function fails on anti_vowel("Hey look Words!"). It returns "['H']" when it should return "Hy lk Wrds!".

I thought adding a loop would solve the problem, but i already did it " for k in text" was my instruction but it said it was out of range, i dont know what im doing wrong, been looking for a similar exercise, hope a moderator can help me out.

def anti_vowel(text):
    #lenght= len(text)
    # text_list = list(text)
    for c in text:
      if text[counter] not in "AEIOUaeiou":
        counter = counter+1
    return no_vowels


why do you have a counter?

simply loop over text, you do this. Now each letter will be in c (your loop iterator), you can check if c variable is not in AEIOUaeiou, and then c to no_vowels list


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