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 trialGerald Wells
12,763 PointsFor loop only giving one item in list
Not sure why I am only getting one part from my computer_parts list.
computer_parts = ['motherBoard', 'processor', 'graphicsard']
vowels = list('aeiou')
output = []
for parts in computer_parts: #breaking down the list
parts_list = list(parts.lower())
#removing vowels by seperating the inital list into a list of letterss
for vowel in vowels:
while True:
try:
parts_list.remove(vowel)
except:
break
#joining words inside of spaces and capatilizing first letter
output.append(''.join(parts_list).capitalize())
print(output)
1 Answer
Chris Freeman
Treehouse Moderator 68,428 PointsYour join and append to output
needs to be indented one stop. It is currently executed once after both for loop complete.
Gerald Wells
12,763 PointsGerald Wells
12,763 PointsI gotcha, it needs to run inside the for loop.