Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python

Sakinah McCoy
Sakinah McCoy
471 Points

Syntax error

if age <= 6: I keep getting a syntax error. I followed Mr. Craig exactly to a T so I'm not sure if this is a support issue or what.

Steven Parker
Steven Parker
216,810 Points

It might be that the error is on a different line, but we'd need to see the rest of the code to tell. Take a look at this video about Posting a Question, and perhaps also this one about sharing a snapshot of your workspace.

1 Answer

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 27,547 Points

Could be a number of reasons this is counted as an error. Share your code and we can comment further.

Two common problems would be:

  1. variable name not assigned.

  2. an error with indentation

Sakinah McCoy
Sakinah McCoy
471 Points

Thank you for your help. I wasn't aware of how to share my code when initially asking my question. It ended up being an error with the indentation. I scraped the code and started over again and then played around with the indentation until it finally worked. Someone left instructions on how to upload code with the question so I'll be sure to do that going forward.