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

Python Python Basics (2015) Logic in Python Conditional Value

why is the code attached showing syntax error?

hi, please help why is the code showing syntax error?

conditions.py
admitted = None
if age >= 13 ;
print ( admitted = "true")

Hello! It looks close, but there are a couple of things to watch out for:

  1. 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.

  2. We don't have to use ";" at the end of our code like in JavaScript.

  3. You want to watch out for the correct spelling of "true" in this case (e.g. is it capitalized or not?).

1 Answer

Gilbert Craig
Gilbert Craig
2,102 Points
  1. The If statement should be terminated by : and not a ;
  2. The Print statement should Ben indented by 4 spaces otherwise it is not considered to be part of the If block
  3. No space between Print and (