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

Lalit Aditya
Lalit Aditya
400 Points

I'm going to create a variable named age. I need you to make an if condition that sets admitted to True if age is 13

How should I write the True condition?

conditions.py
admitted = None

1 Answer

Antonio De Rose
Antonio De Rose
20,885 Points

try break the question, if you are fluent with the lecture, but, if you are confused with the question, and don't know where to start, recommend you to repeat the video over and over

question asks set admitted to True if age is 13

just 2 steps step 1 checking for the condition, checking condition starts with 'if' then you normally check a variable here the variable is age then, the operator to check against the variable which is == now, it is to check the age against the value 13

step 2 setting the variable admitted to True you have done that part, but set up with none, where you have to change to True