Python


#1


https://www.codecademy.com/courses/python-intermediate-en-rCQKw/1/2?curriculum_id=4f89dab3d788890003000096#

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


#2

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

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


#3

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


#4

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