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 trialAndrew Swearingin
264 PointsSetting Variable To True If
I guess I am completely lost on this one.
admitted = None
age = 13
admitted is True if (age) >= 13
3 Answers
Dave Harker
Courses Plus Student 15,510 PointsHi Andrew,
In that challenge the 'age' variable will be set for you, no need to define / assign it. The conditional logic you have is OK, but the syntax is a bit off. Perhaps try something like:
admitted = None
if age >= 13:
admitted = True
Hope that helps. Keep coding :)
Dave
Dvontre Coleman
13,075 PointsIs the challenge asking you to use an if conditional?
I believe the code should look similar to this.
if age>= (insert minimum age here) (insert the outcome ie 'x =true')
Deric Williamson
6,378 PointsI actually done this challenge earlier... so I am still a newbie as well. however I believe that the instructor already set the variable 'age' behind the scenes. so in short, renaming the variable age is against the challenge.
also the if statement should read similar to this: if age is >= to 13 admitted = True.
Andrew Swearingin
264 PointsAndrew Swearingin
264 PointsThe challenge is make the variable True if the age is 13 or more.