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 trial

Python Python Collections (2016, retired 2019) Lists Disemvowel

David Ward
David Ward
1,558 Points

Disemvowel challenge - Where am I going wrong?

Here is my code for the disemvowel challenge. I've ran it locally on an IDE and seem to get the expected result.

def disemvowel(word): vowels=["a","e","i","o","u","A","E","I","O","U"] my_list=list(word)

for letter in word:
    if letter in vowels:
        my_list.remove(letter)
word = "".join(my_list)
return word

disemvowel("Cheeseiookii")

disemvowel.py
def disemvowel(word):
    return word

1 Answer

nakalkucing
nakalkucing
12,964 Points

Hey David! I just copied your code into the challenge and it almost passed. The error I got said that there was an inconsistent use of tabs and spaces. This just means you need to start each line in the code with either four spaces or a tab. Another thing, when you copied your code into this question you only wrote part of it in syntax, so I had to figure out where each of the bits of code that weren't in syntax ended and the next line began, and I might have fixed an indentation error when I did that. :) Was that clear? Let me know if you need more help. :)