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 trialAdrian Brenton
8,110 PointsHaving trouble with my understanding and solving this challenge - help is much appreciated!
Hello everyone,
I've been trying to solve this problem for some time now, and have had no success so far.
I'm concerned that my logic is flawed somewhere, and I can't identify what I'm missing here.
I've attached my latest attempt at coding a solution, and some advice in where my thinking needs adjustment would be much appreciated, as I'd like to be able to figure out a solution for this challenge.
Many Thanks in advance!
Kind Regards
def disemvowel(word):
vowels = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]
disemvoweled_word = []
for letter in word:
if letter not in vowels:
disemvoweled_word.append(letter)
return disemvoweled_word
else:
break
1 Answer
Chris Freeman
Treehouse Moderator 68,441 PointsYou headed in the correct direction!
- if a non-vowel is the first character, the else/break causes the loop to end result in a default
return None
. remove theelse/break
- if a vowel is the first character, it is appended to
disemvoweled_word
then returned immediately. move thereturn
statement outside offor
loop - the expected return object should be a string. use
"".join()
ondisemvoweled_word
to get a string
Post back if you need more help. Good luck!!!
Adrian Brenton
8,110 PointsAdrian Brenton
8,110 PointsThank you for your assistance Chris!