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

syntax

I am getting a syntax error on line one of what was given. Do I need to change the given variable?

conditions.py
admitted = None
if age => 13
   admitted = True
Stivan Radev
Stivan Radev
1,475 Points

I just saw your mistake, actually the 2 mistakes that you made. First, the "=>", just like what Steven Parker said below, it should be ">=" (Thanks @StevenParker) Second, in the video, you can see that he used this " if age > 10000:", as you can see there is this at the end of the number ":". So basically you forgot to put : at the end of the number 13.

admitted = None if age >= 13: admitted = True

Good luck!

1 Answer

Steven Parker
Steven Parker
231,271 Points

The symbol for the operator is the issue. The correct symbol for a "greater than or equal" comparison is ">=".

And as Stivan pointed out, an "if" statement should end with a colon.