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

How do you do this

On task one, it pops up with an error that says that the task must pass, so I set age to 13. But then on task two it pops up with an error that says not to set the age variable.

conditions.py
admitted = None
age = 13
if age >= 13:
    admitted = True
else:
    admitted = False

2 Answers

Here's my solution:

admitted = None

if age >= 13:
    admitted = True
else:
    admitted = False

The age isn't something you create, the challenge just passes it in magically to test your code!

Thanks

Happy to help!

the task does not ask you to declare a variable 'age' or assign a value to it, nor to provide and 'else' statement

If you remove the second and last 2 lines it will work

Just so you know, the last two lines of code were for the second task, but thanks for trying to help