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 trialEsther Strom
8,028 PointsWorkspace not indenting correctly
When I try to follow along with the code in this lesson, the workspace does not correctly indent (or rather, out-dent) the except block. No amount of manual jiggering of spacing will allow it to run.
This is what it looks like:
user_string = input("What's your word? ")
user_num = input("What's your number? ")
try:
our_num = int(user_num)
except:
If I adjust the spacing manually and continue, I get this error when trying to run:
IndentationError: unindent does not match any outer indentation level
3 Answers
jason chan
31,009 Pointsdelete up adjacent line and then return. make sure the indents are 4 spaces if not it will break. The indents are supposed to mean brackets.
Osama Ahmaro
11,544 PointsI usually get this error when i am mixing tabs with spaces, try to only use spaces when indenting and that should solve it.
jason chan
31,009 PointsTry using sublimetext or notepad++ or code or brackets. In professional world your going to use those tools. Or some other ide.
Esther Strom
8,028 PointsEsther Strom
8,028 PointsI'm using the Treehouse workspace, though - it automatically indented and unindented in the previous exercises. I'm not actually using spaces or tabs, just expecting it to behave consistently.