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

help me pass this challenge

please help me solve this challenge. thank you

conditions.py
admitted = None
age = 13
if age > 13
    print("admitted")

2 Answers

Justin Olson
Justin Olson
13,792 Points

Hiya!

From what I can see, there are two thinks keeping this from going forward.

The first, is the IF statement is missing the ':' after the condition. The second, is the condition is asking for a number GREATER than 13. As the age is set to 13, there will be nothing to return. This can be resolved numerous ways.

Make the statement say >= 13, so 13 can be included, or add an Else statement saying 'not admitted' since anything not > 13 would be false.

Here are examples of both:

admitted = None
age = 13
if age >= 13:
    print("admitted") 
admitted = None
age = 13
if age > 13:
    print("admitted")
else:
    print("not admitted")

Hope this helps out!!

Hi there!

A couple of things to note.

First when you write an if statement you must have : at the end.

Second, when I looked at the challenge it states it is going to give you an age variable so you do not have to write age = 13.

Third, when I looked at the challenge it says if age is 13 or more meaning you need to make if statement where age is equal and greater than 13.

Last, the challenge does not ask you to print admitted but set admitted equal to True if age is 13 or more.