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

can someone help with this code

some of the errors include

disemvowel.py
def disemvowel(word):
    vowel=["a", "e", "i", "o","u"]
    for letters in vowel:
        if letters.uppercase()
            letters.remove()
        elif letters.lowercase == vowel:
            letters.remove()
    return word

OK, I need you to finish writing a function for me. The function disemvowel takes a single word as a parameter and then returns that word at the end.

I need you to make it so, inside of the function, all of the vowels ("a", "e", "i", "o", and "u") are removed from the word. Solve this however you want, it's totally up to you!

Oh, be sure to look for both uppercase and lowercase vowels!

2 Answers

Evan Picone
seal-mask
.a{fill-rule:evenodd;}techdegree
Evan Picone
Full Stack JavaScript Techdegree Student 14,203 Points

def disemvowel(word): vowel=["a", "e", "i", "o","u"] for letters in vowel: if letters.uppercase() letters.remove() elif letters.lowercase == vowel: letters.remove() return word

Hey Abdurahman,

Instead of assigning all the vowels to the variable vowel. Assign vowel to an empty string. You should look for letters in word, not vowel. So, for letters in word: You don't need to write uppercase() instead type .upper() or .lower(). Ask what letters you don't want to include "aeiou". if letters.lower() not in "aeiou": vowel += letters Then you want to return vowel Lastly, print(disemvowel(word))

type out the solution please, wont be back i just think its important to assume more than one person will be visiting this , i dont get why they dont just put a solution option....thx

Chandrakant Radaye
Chandrakant Radaye
1,406 Points

def disemvowel(word): word_list = list(word) for each_word in word_list.copy(): if each_word.lower() in ["a", "e", "i", "o", "u"]: word_list.remove(each_word) return "".join(word_list)