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

Converting existing tabs to spaces IndentationError: unindent does not match any outer indentation level

Hello all. Not sure if this is legal here but I figured I would give it a try.

in the workspace, I somehow used a mixture of Tabs and Spaces in my code. It was driving me absolutely bonkers because nothing would work. Running the code would either give me the IndentationError or the TabError. When I searched the forums the only answer I could find was that I would have to go back and manually change all existing tabs to spaces. This did not seem optimal. after a quick search, I found this site and it saved my entire evening. Now I don't know if I am allowed to throw other sites on here but let's give it a shot.

https://www.browserling.com/tools/tabs-to-spaces

Thanks, Vincent

1 Answer

Steven Parker
Steven Parker
230,248 Points

A reputable 3rd party site shouldn't be a problem, but a sketchy one might. I can't view your code because I get an authenticity verification failure from my browser.

Also, you've posted this in "General" instead of a language group. But I'm going to guess your program is in Python, and one of the rules of Python is that you may use tabs or spaces, but not both in the same program. So you'll just need to convert to one or the other (I recommend spaces) and use it consistently.

You can edit the question and move it to the appropriate group if you want.

Thank you for the info, Mr. Parker. I will change it too the python forum.