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 trial

Python Python Basics (2015) Logic in Python Conditional Value

conditional 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!

conditions.py
admitted = None
age = 13 
if age < admitted:
    print("True")

3 Answers

You 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

thanks for your help!

Hi 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!]

thanks!

Timothy Donley
seal-mask
.a{fill-rule:evenodd;}techdegree
Timothy Donley
Python Web Development Techdegree Student 1,365 Points
admitted = 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.