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 trialMaggie Wolff
495 Pointsconditional value challenge task 1 of 2
I can't figure this out, and I looked through my notes.
admitted = None
age = '13'
if age == '13':
admitted = true
2 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Maggie,
The challenge instructions mention that it will create an age variable for you so that's not something you have to do in your code.
For your if
condition, you have to check if the age is 13 or more so you would need to use the >=
operator, greater than or equal to.
And in python the boolean True
and False
values have to be capitalized.
You should be able to pass after making those changes but let me know if you're still stuck.
Maggie Wolff
495 Pointsthank you!
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsOne more thing I forgot, you don't want to put quotes around the
13
. That would make it a string but you want it to be an integer.Maggie Wolff
495 PointsMaggie Wolff
495 Pointsit says there is something wrong with line 5
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsOk, for the second task, you have the right code but it's indented too far. Indentation is very import in python because that controls where the code belongs.
Your
else:
and theadmitted = False
need to go back one level of indentation.The
else:
should be lined up with theif