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 trialConary Beckford
Full Stack JavaScript Techdegree Student 5,046 PointsIf else
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 or more
admitted = None
if(admitted) >= 13:
print("True")
3 Answers
Jennifer Nordell
Treehouse TeacherHi Conary Beckford! I received your request for assistance. Right now, you're trying to check if the value of admitted
is greater than or equal to 13, but you should be checking if the variable age
is greater than or equal to 13. The parentheses around your in your if
statement are causing a syntax error and should be removed, but again admitted
should be changed to age
. To be clear, the age
variable will be created and assigned a number by Treehouse. This is not something you need to take care of yourself.
After you determine if age
is greater than or equal to 13, you then need to set admitted
to the boolean value of True
. Instead, you are printing the string "True".
I think you can get it with these hints, but let me know if you're still stuck!
Conary Beckford
Full Stack JavaScript Techdegree Student 5,046 PointsThank you. That was great
Conary Beckford
Full Stack JavaScript Techdegree Student 5,046 PointsI chose you to help me because from your profile you've accomplished alot. I hope to one day be as knowledgeable as yourself.
Conary Beckford
Full Stack JavaScript Techdegree Student 5,046 PointsConary Beckford
Full Stack JavaScript Techdegree Student 5,046 PointsStill no luck:
admitted = None if age >= 13: print("True") else: print("False")
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherAgain, you're not supposed to print anything. Take a look:
admitted = True
Give it another shot!