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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Cam Treschuk](https://secure.gravatar.com/avatar/d2fa639659f37fcca6447b2a027dab82?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Cam Treschuk
7,378 PointsI am having a problem with the challenge. It gives me a syntax error on line 1, but line 1 was part of original code
admitted = None if age >= 13 then admitted = True
admitted = None
if age >= 13 then
admitted = True
3 Answers
![Samuel Ferree](https://secure.gravatar.com/avatar/514643963ecad21d3b9c5b961855909b?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Samuel Ferree
31,722 PointsNot sure why it says the error is on line 1, but python uses a colon (:) instead of 'then' after if statements
admitted = None
if age >= 13: # use : not 'then'
admitted = True
![Katie Wood](https://uploads.teamtreehouse.com/production/profile-photos/7624672/micro_20160812_161220.jpg)
Katie Wood
19,141 PointsWhile it does say line 1 when I try it also, the actual issue is on line 2 - python doesn't use the if-then format, but rather a colon to end the 'if' line. If you take out the 'then' and add a colon (:), it should pass. Like this:
admitted = None
if age >= 13:
admitted = True
![Jason Anders](https://uploads.teamtreehouse.com/production/profile-photos/3512822/micro_Jason_s-Pic.jpg)
Jason Anders
Treehouse Moderator 145,859 PointsFor those wondering about why the compiler stated line #1 ...
In programming, pretty much every time you have a syntax error, the compiler will indicate the previous line, but this isn't really what the compiler is doing. When is says line #1, it is saying that that was as far as it could go before the code 'broke'. The compiler could not compile line #2 because of the error, so, it its 'world' line #2 doesn't really exist, so it thinks the problem happened after line one compiled.
In short, whenever you get a line number "showing" a problem, always look at the line (or even lines) after the line number given.
I hope this helps to clarify why it was "Line 1" and not Line 2 that the compiler threw out.
Keep Coding :)