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 trialArpit Singh
942 PointsPython collection, Disemvoweled
Why my function is not removing all the vowels. how is its flow going
states = ['alabama','oklahoma','california','florida']
v = list('aeiou')
output = []
for state in states:
state1 = list(state)
for a in state1:
if a in v:
state1.remove(a)
output.append(''.join(state1))
print((output))
1 Answer
Matthew Hill
7,799 PointsCheck your formatting so that you're appending your answer after you've looped through all the characters in your list of state letters. Also, you've not used
def function_name(list_name):
So you haven't actually defined a function. Finally, you are printing your results and not returning them from your function. Hope these help, Matt
Vittorio Somaschini
33,371 PointsVittorio Somaschini
33,371 PointsHey Arpit.
I have edited your questions a bit so that it matches these formatting guidelines: https://teamtreehouse.com/forum/posting-code-to-the-forum ;)