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.

Michael Revy
3,882 Pointsdisemvowel
I get Bummer! Hmm, got letters did not expect - or similar.
I loop thru vowel list and while I can find vowels in the word, I remove, then on to next vowel. I also force lowercase.
def disemvowel(word):
disem = list(word.lower())
vowels = ["a", "e", "i", "o", "u"]
for i in range(len(vowels)):
while True:
try:
disem.remove(vowels[i])
except ValueError:
break
return ''.join([i for i in disem])
word = "CaaaPgZZUUiRfseEYooOj"
cipher = disemvowel(word)
print(word)
print(cipher)

Michael Revy
3,882 PointsI see my mistake .. I should not lower case any consonants !!! Removed lower and added uppercase vowels

Perfect Tinotenda Mashingaidze
5,070 PointsHelp man me with full working code I'm stack man its been days please help!!!
1 Answer

Stuart Wright
41,103 PointsI have amended the one line solution you've posted a little to get the correct solution:
def disemvowel(word):
return ''.join([i for i in word if not i in 'aeiouAEIOU'])

Perfect Tinotenda Mashingaidze
5,070 PointsCan yu help me with full working code please!!
Michael Revy
3,882 PointsMichael Revy
3,882 PointsI entered a very elegant solution (not my own - Brandon Jaus)
def disemvowelb(word): return ''.join([i for i in word.lower() if not i in 'aeiou'])
but this still gives me the Bummer! I tested with several long words and seemed to work fine.