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 trialJaylin Barrett
276 PointsIndentationError: unindent does not match any outer indentation level
I have my code exactly like the way it's in the video. Maybe I'm being overly dramatic as I did spend half an hour reviewing the code and repeating the video to see if this would change anything but nothing seems to change the fact that the code mistakes spaces and tabs for whatever reason
2 Answers
Steven Parker
231,236 PointsOther than the minus sign (-
) on line 8 which was probably intended to be an assignment operator (=
), this code seems to be OK. But something that might not have come across in copying it here might be a mix of tabs and spaces.
Python will work with either, but it is important for the whole file to be consistent. Tabs on some lines and spaces on others could possibly cause this issue. Check for that.
Steven Parker
231,236 PointsMarkdown formatting translates tabs into spaces, so regardless how it was entered the code shown above is indented with consistent spacing. My suggestion is to copy that code and paste it into the editor to create a new file. If it runs without causing the error you have identified the issue.
Jaylin Barrett
276 Pointsif you don't mind, how would I check for that. I tried searching google and what came up is a built in string called isspace. Due to website being the only current way that I'm learning, I don't know how to use that right now
Jaylin Barrett
276 PointsJaylin Barrett
276 PointsThat's how I have my code and the problem seems to be print("you should TOTALLY learn python, {}!".format(first_name))