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

Jimmy Koyan
Jimmy Koyan
3,308 Points

Issues in the Python basics code challenge. "OK, one more. Add an else to your if. In the else, set admitted to False."

So the challenge is this "OK, one more. Add an else to your if. In the else, set admitted to False." and my solution to the question was the simple program

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

When I check the work the response is "Bummer! 'admitted' is not False"

I am not sure what's wrong here?

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

3 Answers

mocpanu paok
mocpanu paok
84 Points

You don't have to set "age = 13" to your program. The test will check with different values of age

Jimmy Koyan
Jimmy Koyan
3,308 Points

Thank you!. That helped.

Hey Guys. My code doesn't pass successfully why ?!

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

I have indented the code properly in my workspace, but when I copy paste it here, it would show is as one line.

Hashin Hassan
Hashin Hassan
1,738 Points

I have the same problem. can't get past this bummer.

admitted = None

if age >= 13: admitted = True

else: admitted = False

mocpanu paok
mocpanu paok
84 Points

As others have commented, you should indent your code properly.