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

Jonathan Whelchel
Jonathan Whelchel
2,096 Points

Ok I understand conditional code, but I do not understand what the instructions are asking me to do here.

I don't understand the instructions...this is confusing. I understand if statements. Just don't know what I'm being asked to do here

conditions.py
admitted = None

2 Answers

andren
andren
28,558 Points

It is asking you to:

  1. Create an if statement that checks if age (a variable that is created for you automatically) is equal or greater than 13

  2. If it is then set the admitted variable equal to True. This is done in the same way you assign strings or numbers to a variable except that you have to assign the Boolean value True. Which is written without quotes or anything like that.

Here is an example of how you would set a variable to True:

example = True

It is as simple as that, just assign it the word True without any quotes or anything surrounding it. The same holds for the other Boolean value False which will be used in the second task.

And I'll repeat one thing since this is something a lot of people seem to get confused about. You are not required to create an age variable, that is done automatically by the code checker. So you can just assume that a variable with that name already exists and just reference it in your if statement. Do not create an age variable and assign it a value yourself, that will break the challenge checker.

Jonathan Whelchel
Jonathan Whelchel
2,096 Points

Hey! Just going thru this exercise again. I am trying to make the if statement but am getting a syntax error:

if age > 13 admitted = True