I need to understand why this method doesn't work in python, whereas it may work perfectly in java.

Replace this line with your code. 

def anti_vowel(x):
    for i in list(x):
        for c in "aeiouAEIOU":
            if i!=c:
                print i


def anti_vowel(x):
    for i in list(x):
        if i not in "aeiouAEIOU":
    print c

I changed it a bit but the result still shows an error


that looks pretty good, except your function should return the reversed string. Currently your function prints the reversed string


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