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 trialJonathan Whelchel
2,096 PointsOk 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
admitted = None
2 Answers
andren
28,558 PointsIt is asking you to:
Create an
if
statement that checks ifage
(a variable that is created for you automatically) is equal or greater than 13If it is then set the
admitted
variable equal toTrue
. This is done in the same way you assign strings or numbers to a variable except that you have to assign the Boolean valueTrue
. 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
2,096 PointsHey! 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