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

I'm going to create a variable named age. I need you to make an if condition that sets admitted t

how do i solve it

conditions.py
admitted = None
age = 13 * 365
if age > 1000

2 Answers

Eray Ates
Eray Ates
14,292 Points

After the statements but : and get new line with indentation check this:

admitted = None
age = 13 * 365
if age > 1000:
    admitted = True
else:
    admitted = False

In this question age value give us from UP. So don't assing a value on it.

Also you can do it in just one line, I think you will learn it from next documents:

admitted = True if age > 1000 else False
rossmunro2
rossmunro2
2,967 Points

You don't need to set the age, Ken is doing that for you, you simply need the if statement and the result.

I got stuck for ages, the question says 13 or greater, so the if context is > 12.

admitted = None
if age > 12:
    admitted = True