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

traolach trewhella
PLUS
traolach trewhella
Courses Plus Student 835 Points

I DID THIS RIGHT STILL DIDINT WORK ANSWERS

CORRECT ME IF IM WRONG

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

2 Answers

Matt Nickele
Matt Nickele
468 Points

The else should be equal with the if and no semi-colons

Fable Turas
Fable Turas
9,405 Points

There are 3 things that I see here.

The first 2 are minor things that strictly speaking won't effect your outcome, but are important to note when writing good Python.

The first: Python doesn't use semi-colons to close out lines.

The second: You do not need an 'else' statement to fulfill the request of the challenge since you already have a value for 'admitted' that is Falsey, so you only need to change it to True when the True condition is met. If the condition isn't met it will stay set to the Falsey value and 'admitted' will evaluate to False in any subsequent condition without you writing the extra lines to set an explicit 'else'.

The third thing I see is most likely the reason your code is not passing though. Python is a white space based language. Your tabs are important. If you over or under tab, your code will break.