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 trialpriyanka shukla
3,051 Pointswhy is the code attached showing syntax error?
hi, please help why is the code showing syntax error?
admitted = None
if age >= 13 ;
print ( admitted = "true")
1 Answer
Gilbert Craig
2,102 Points- The If statement should be terminated by : and not a ;
- The Print statement should Ben indented by 4 spaces otherwise it is not considered to be part of the If block
- No space between Print and (
Clifford Gagliardo
Courses Plus Student 15,069 PointsClifford Gagliardo
Courses Plus Student 15,069 PointsHello! It looks close, but there are a couple of things to watch out for:
The challenge only asks for a variable to be reassigned and not printed. But if you did want to print it, I would double check to see if we do or do not need any space between print and the parentheses.
We don't have to use ";" at the end of our code like in JavaScript.
You want to watch out for the correct spelling of "true" in this case (e.g. is it capitalized or not?).