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 trialbasil dhillo
Courses Plus Student 240 PointsHow can i solve this ??
I can't the understand the logic of question
admitted = None
age = 1
if age >= 13:
print(None)
2 Answers
Stuart Wright
41,120 PointsThe challenge isn't asking you to print anything. It is asking you to set the variable 'admitted' to True if the condition is true.
admitted = None
if age >= 13:
admitted = True
basil dhillo
Courses Plus Student 240 PointsThank You Jennifer Nordell
basil dhillo
Courses Plus Student 240 Pointsbasil dhillo
Courses Plus Student 240 PointsThank you sir
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherStuart is correct, but another note I'd like to make is that Treehouse is going to run this code. So they're going to set the value of age on their end (possibly multiple times). This means that your
age = 1
is overwriting what they're sending in and will also result in the challenge failing.Going forward in the challenges try not to do anything that the challenges don't explicitly ask for. Even if functional outside the challenge, it can cause the challenge to fail.
Good luck to you!