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
daniel escobar
Courses Plus Student 563 PointsWhy do i get an indentation error i am using print() after an if statement
Why am i getting an identation error in workspaces
if today in days_open: print ("Come on in") ...but i get an indentation error
AJ Salmon
5,675 PointsI can't be sure what your specific problem is, but from my experience, it's most likely due to you mixing spaces with tabs. I've definitely done this before (on multiple occasions, haha), and I don't remember Kenneth talking too much about it, but basically, you can either hit tab or hit the space bar 4 times to indent your code, but you can only pick one of those methods. Either will work, but once you pick one you have to stick with it throughout that entire chunk of code. Troubleshoot this by deleting the indented space on every line and then re-inserting it with the correct number of tabs (or sequences of four spaces. Just not both of them on the same line.) Hopefully this helps!
1 Answer
Gerard Nwazk
Courses Plus Student 2,833 PointsAfter the if statement press <ENTER> on the second line press <TAB BUTTON> to make an indent of 2 or 4 spaces depending in the code editor you are using lastly avoid using <SPACE BUTTON> in your code or code environment that's the key of avoiding indentation error. format you code to look like mine below.
if today in days_open:
print ("Come on in")
hope it works...
Steven Parker
243,656 PointsSteven Parker
243,656 PointsFor your indentation to display properly, edit your question and use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area.
 Or watch this video on code formatting.