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

SEUNG IL YANG
SEUNG IL YANG
1,035 Points

How to get rid of vowels?

Hello I am currently new to python language and trying to solve the problem here

Could you give me some help where I got something wrong here please??

Thanks for your prompt reply

disemvowel.py
def disemvowel(word):
    List = []
    Vowels = ["a", "e", "i", "o", "u"]
    for i in word:
        if i not in Vowels:
            List.append(i)
            word = List    
    return word

1 Answer

Steven Parker
Steven Parker
231,269 Points

You're very close! I can see only two issues:

  • you need to remove both upper case and lower case vowels
  • you need to join your list back into a string before you return it
SEUNG IL YANG
SEUNG IL YANG
1,035 Points

Thanks for helping me. Mr Parker :>