Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Collections (2016, retired 2019) Lists Disemvowel

Chang Hyeon Lee
Chang Hyeon Lee
2,008 Points

I don't still get passing this challenge...

I need some help and explanation..

disemvowel.py
def disemvowel(word):
    result = ''
    vowels = ['a', 'e', 'i', 'o', 'u']

    for letter in word:
        if letter.lower not in vowels:
            result += letter

    return result

The way you're doing it here is checking if the built-in method, 'lower' of string object '<letter>' can be found in your vowels list. Typing 'i'.lower by itself into the python command line will show you. To call the method lower on your letter, you'll need to add '()' to your method name. So if letter.lower() not in vowels:

1 Answer

Your issue is in letter.lower, lower() is a function, so it should have () double parenthesis at the end.

Change this line:

if letter.lower not in vowels:

To:

if letter.lower() not in vowels: