Anti-vowel issues


#1



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)


#2

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


#3

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: https://www.udacity.com/wiki/cs258/truthiness-in-python) @mtf told me about this and has some really helpful posts here: https://discuss.codecademy.com/t/anti-vowel-boolean-troubles-and-no-print-out/54373?u=lisacc

Keep it up!


#4

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