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 trialLaknath Gunathilake
1,860 Pointscant seem to pass this challenge
when I set the age to something greater than 13, I can pass the 1st task, but without it I cant. In the second task it says they will set the age for you, but I cant get through the second task
admitted= None
age=
if age>=13:
admitted='true'
1 Answer
Daniel Santos
34,969 PointsHello Laknath,
I just checked the problem, Kenneth is going to create an age variable for you, so you really don't have to create one. On the other hand, your first statement is correct and that is why you are passing the first challenge, but now, in the second challenge you have to make the else statement to set admitted = False.
By the way, it is True, not 'true'.
Does that make sense?
Let me know :)
Laknath Gunathilake
1,860 PointsDaniel, thank you for the comment. I tried the following, but it says "invalid syntax (<string>, line 1)" ..... admitted = None age= if age>=13: admitted=True else: admitted=False ......
Daniel Santos
34,969 PointsIs this similar to what you have?
admitted = None
if age >= 13:
admitted = True
else:
admitted = False
Laknath Gunathilake
1,860 PointsThank you it worked.
Daniel Santos
34,969 PointsBut do you understand it?
Laknath Gunathilake
1,860 PointsYes I do, I left the age variable undefined in line 2. Instead I should have done age>=13:
jacinator
11,936 Pointsjacinator
11,936 PointsI don't think that you can leave a variable undefined. Try assigning it to an age. Also the challenge is asking you to define
admitted = True
instead ofadmitted = 'true'
.