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 trialDebdipta Dasgupta
431 PointsCouldn't understand where am I going wrong
I have solved the first part of the challenge.But in the second part of the challeng I can't understand where I am going wrong with the else function. Would appreciate your help with the second challenge
admitted = None
2 Answers
Carlos Federico Puebla Larregle
21,074 PointsYou just need to add an "else" statement and assign the value False to the variable named "admitted". Do it like this:
admitted = None
if age >= 13:
admitted = True
else:
admitted = False
Carlos Federico Puebla Larregle
21,074 PointsThe variable "age" is going to be created for you, then you have to check if that "age" variable is greater of equal to the number 13. You could do it like this:
admitted = None
if age >= 13:
admitted = True
I hope that helps a little bit.
Debdipta Dasgupta
431 PointsI have solved this challenge.Where I got struck is the 2nd part of the challenge where else function will be used. Thanks
Debdipta Dasgupta
431 PointsDebdipta Dasgupta
431 PointsThank you so much for the help!!!!