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 trialAlejandro Byrne
2,562 PointsWhat am I missing?
I think I have my code figured out, how do I make it remove all upper cases too?
def disemvowel(word):
word = word.list()
word.remove('a', 'e', 'i', 'o', 'u')
return word
1 Answer
Alexander Davison
65,469 PointsOk, here's an error list:
.list()
sadly isn't a Python function on strings. However, there is
a function called list()
that take sin a string as am argument!
You can only pass in ONE argument to remove
.
Even if you can pass in multiple arguments to remove
to call lots of remove
s, it only will remove the first vowels.
Keep in mind that .remove()
_only removes the first existence of an element!
Here's a checklist. To fix your program, you should follow these steps
Set word equal to list(word)
, not word.list()
.
Make a loop to go through all of the elements of the list. If the element is in the list ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
using the in
keyword.
If the current element is in the vowel list, remove the items with .remove()
.
I hope this helps. If you need more hints, please reply. Thanks!
I hope this helps. ~Alex