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 trialYosef Fastow
18,526 PointsWhat is this Tab Error about?
I'm getting a Tab Error that I don't understand... Tab Error: inconsistent use of tabs and spaces in indentation
Why am I getting this Error and how do I prevent it?
1 Answer
Evan Demaris
64,262 PointsHi Yosef,
The error you're describing is caused by including both a tab and spaces to indent code in the same file. Python doesn't know how many spaces are intended by a tab for your code specifically, so it throws the error instead of guessing and potentially having unexpected results when the code is run. This error can be avoided by using an IDE which converts tabs to spaces, only using tabs for indentation, or only using spaces for indentation.
Hope that helps!