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 trialChris H
Python Web Development Techdegree Student 1,368 Pointsconditional value task 1
Still not understanding what i am doing wrong on task 1, i have been stuck on this one for a day now. Any hints would be GREATLY appreciated. Thanks all!
admitted = None
age = 13
if age < admitted:
print("True")
3 Answers
dojewqveaq
11,393 PointsYou just want to know if the age is greater than 13 and change the value of admitted accordingly. So... You can't set the age to 13 in your code. Here is how it should look like.
if age > 13:
admitted = True
else:
admitted = False
Steve Hunter
57,712 PointsHi there,
You don't set the value of age
. You just test if
the value held in age
is more than, or equal to, 13. If it is set admitted
to True
. There's no printing to the screen.
So, delete your line age = 13
and consider what your if
statement is saying.
I hope that helps.
Steve.
[edit - corrected the less than to more than!]
Chris H
Python Web Development Techdegree Student 1,368 Pointsthanks!
Timothy Donley
Python Web Development Techdegree Student 1,365 Pointsadmitted = None
if age >= 13:
admitted = True
else:
admitted = False
this is the correct code to pass task 1 and 2 the wording is bit weird but later in the track you will understand that he is mimicking an input.
Chris H
Python Web Development Techdegree Student 1,368 PointsChris H
Python Web Development Techdegree Student 1,368 Pointsthanks for your help!