Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Noah Harness
1,383 PointsI suck at programming and its making me upset
I don't know how to do this shit.
blank_word = ""
vowels = ["a", "e", "i", "o", "u"]
def disemvowel(word):
for letter in word:
if letter not in vowels:
blank_word += letter
print(blank_word)
1 Answer

Umesh Ravji
42,361 PointsHi Noah, you pretty much have the answer there :) You do know how to do it.
vowels = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"] # have to include both upper and lower cases
def disemvowel(word):
blank_word = "" # better as a local variable inside the function
for letter in word:
if letter not in vowels:
blank_word += letter
return blank_word # remember you want to return this, not print it out
SC3 Rocks
33,474 PointsSC3 Rocks
33,474 Pointsif you want to avoid including capitals and lowercase letters in
vowels
, you can just checkif char.lower() not in vowels:
. That way, no matter what the case ofchar
is, it'll still be in the list.