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

basil dhillo
PLUS
basil dhillo
Courses Plus Student 240 Points

How can i solve this ??

I can't the understand the logic of question

conditions.py
admitted = None
age = 1
if age >= 13:
    print(None)

2 Answers

Stuart Wright
Stuart Wright
41,118 Points

The challenge isn't asking you to print anything. It is asking you to set the variable 'admitted' to True if the condition is true.

admitted = None
if age >= 13:
    admitted = True
Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Stuart is correct, but another note I'd like to make is that Treehouse is going to run this code. So they're going to set the value of age on their end (possibly multiple times). This means that your age = 1 is overwriting what they're sending in and will also result in the challenge failing.

:bulb: Going forward in the challenges try not to do anything that the challenges don't explicitly ask for. Even if functional outside the challenge, it can cause the challenge to fail.

Good luck to you! :sparkles: