Anti-vowel issues


I cannot figure out what is wrong with my code:

 text=raw_input("enter text")

def anti_vowel(text):
    for c in text:
        if c=='A' or c=='a' and c=='e' or c=='E' and c=='I' or c=='i' and c=='o' or c=='O' and c=='u' or c=='U':
            print text
print anti_vowel(text)


should return a string with the censored text. So you need to make a string a list/string to append the constants to.


I had the same problem! It turns out that 'o' is truthy in python. In each data type there are different values that are read as True or False, summarized here: @mtf told me about this and has some really helpful posts here:

Keep it up!


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