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 trialAlex Ray
7,422 PointsOutput from Vowel List is unexpected
When I run this programme, the out put gives me the list of words 4 times in a new list and not the words with the vowels removed.
Here is the link to my code https://w.trhou.se/4ecuobkzr0
Please help!
1 Answer
Gunhoo Yoon
5,027 PointsThis line has troubles.
output.append(','.join(word_list).capitalize())
You broke down each item in word_list to vowel_list. But now you are joining word_list which will give you whole list again.
You are joining with comma this will result (if you fixed first problem) ['D,v', 'J,m,p' ...] unless this is intentional.
Fixed line
output.append(''.join(vowel_list).capitalize())
Also few things that can be improved.
readability can further be improved. (hint: utilize use of 'in')
try to come up with better solution for terminating while loop.