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

Emilio Andere
Emilio Andere
495 Points

I do not understand the instructions

help

conditions.py
if admitted > 13
    print("Cool")

admitted = 14

2 Answers

Steven Parker
Steven Parker
229,732 Points

The instructions say to test "if age is 13 or more", so you have the "more" part but you still need to include when it is 13. But they also say that when the condition meets the test the code "sets admitted to True", you'll need to do that instead of the print (you won't need to print anything for this challenge*.

Also, don't remove the code line that was provided to set the initial value of admitted.

Emilio Andere
Emilio Andere
495 Points

admitted = None if age >= 13 "sets admitted to True"

why is this wrong

Steven Parker
Steven Parker
229,732 Points

With no formatting, it's not possible to tell if your indentation is correct. But assuming that it is, your "if" line is missing the colon at the end, and the code that sets admitted to True would not be words in quotes but would look like this:

    admitted = True

Use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down:   Or watch this video on code formatting.

Emilio Andere
Emilio Andere
495 Points

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

Now this says that is incorrect!!!!!!!!!

Steven Parker
Steven Parker
229,732 Points

Please use formatting when posting code, otherwise it's impossible to see if the indentation is correct.

But otherwise it looks like you forgot the colon after the "else".