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

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

Hi there!

I find this exercise very dificult to understand. Can anyone enlighten me as to what exactly is required.

Regards

1 Answer

Greg Kaleka
Greg Kaleka
39,021 Points

Hi Miguel,

I'm pretty late in answering, but hopefully this is still helpful!

This is a tricky one! I've seen lots of questions about it, so you're not alone.

The goal here is to write a function that takes any string as an input and outputs that string with all the vowels removed.

Example: if you call disemvowel('Um, here is a string with vowels in it'), it would return "m hr s strng wth vwls n t"

There are a few ways you could do this - it's left pretty open. Here's a clue: a string is iterable in python. So you could loop over each character in word and add it to a result variable that starts as an empty string if it's not a vowel, then return result instead of word.

Cheers :beers:

-Greg