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

3 Answers

andren
andren
28,558 Points

There are three mistakes in your code:

  1. You have written if with a capital I, most programming languages (including python) are case-sensitive, this means that If, if and iF are not considered to be the same word, and getting the capitalization right when using keywords like if is essential.

  2. The greater or equal to operator is: ">=" not "=>" the order of the symbols matter.

  3. When you use double quotes you are telling Python to treat your text as a string value, so you are setting admitted equal to a string with the text "True", which is different from the boolean value True, boolean values are typed without quotes, just like numbers and variables.

Fixing those three mistakes results in this code:

admitted = None

if age >= 13:
    admitted = True

Which is the solution to the first task of the challenge.

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Duarte;

Small syntax changes are needed in your code. You are wanting greater than or equals to, have a look at the documentation for what the proper comparison operator is for that comparison. Also, should you be setting admitted to a string?

Post back if you are still stuck.

Happy coding,
Ken