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

IndentationError: unindent does not match any outer indentation level (disemvowel.py, line 4)

Hello, I am doing the challenge and I stuck on indentation Error before even checking if this is correct. Does anyone see where I have a mistake? where Can I learn indentation error and syntax error removal???

disemvowel.py
def disemvowel(word):
    for word in disemvowel:
        word.remove('a','e','i','o','u','A','E','I','O','U')
    return word

1 Answer

Steven Parker
Steven Parker
229,732 Points

Where do you get the indicate of an indentation error? You've got some issues here, but indentation doesn't seem to be one of them.

When I try your code in the challenge it says, "Bummer: TypeError: 'function' object is not iterable". This makes sense, because the function name is being used in the loop. You won't need the function name inside the function.

A few other hints:

  • the argument is a string, but "remove" only works on lists
  • also, "remove" only takes one argument
  • you'll want to return something other than the original "word"