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

Martin Bornman
PLUS
Martin Bornman
Courses Plus Student 12,662 Points

if

If I set the else statement to False it's incorrect

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

2 Answers

Nathan Tallack
Nathan Tallack
22,160 Points

Yeah, this one got me too. They acutally say in the challenge that they will declare the age variable for you.

So remove your declaration for the age variable and it'll work just fine. ;)

Oleg Polyakov
Oleg Polyakov
30,453 Points

I checked and it actually worked both ways (with and wthout declaring age = 13) for me! Have you resolved it? Maybe there is a problem with Workspaces.