8. anti_vowel: Getting the following error...why?



Oops, try again. Does your anti_vowel function take exactly one argument (a string)? Your code threw a "unsupported operand type(s) for -=: 'str' and 'str'" error.

  File "python", line 5
    string += char
IndentationError: expected an indented block


def anti_vowel(text):
    string = ""
    for char in text:
        if char not in "aeiouAEIOU":
        string += char 
    return string
print anti_vowel(Fabrice)


Hi this line

string += char

should be indent inside the if statement then here

print anti_vowel(Fabrice)

fabrice should be a string


Thank you! Easy troubleshooting I should have caught that -_-


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