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

Andreas Wassberg
Andreas Wassberg
5,856 Points

Conditional Value - Code Challenge

Cant seem to fix this problem. Help?

Ken Alger
Ken Alger
Treehouse Teacher

Andreas;

Can you post the code you have been trying?

Thanks,
Ken

Andreas Wassberg
Andreas Wassberg
5,856 Points

admitted = 1 age = 13 if admitted < age: print("True")

8 Answers

rdaniels
rdaniels
27,258 Points

This will work to complete both challenges:

admitted = None


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

none of these answers are working for me

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Andreas;

Task 1

I'm going to create a variable named age.
I need you to make an if condition that sets admitted to True if age is 13 or more.


Great, we are provided with an age variable, so we don't want to reassign that, but just check for it's value in our if statement. Then, if age is greater than or equal to (>=) thirteen we want to assign admitted a Boolean value of True. In code that would look something like:

if age >= 13:
    admitted = True

Does that make sense? Post back if you are still stuck.

Happy coding,
Ken

that does not work for me

Young ki Jang
Young ki Jang
519 Points

Can anyone help me what is wrong?

admitted = None

if age >= 13:
    admitted = True
Andreas Wassberg
Andreas Wassberg
5,856 Points

I got it! I guess it was the question itself that I didn't get. Thanks a lot!!!

diego cortes
diego cortes
1,421 Points

Thanks Ken Alger, i get it now.

coffee shops!!!

me i still dont get it. is it possible to have a clue or a clear question in the help section.. cause searching g[for answers on google might create a reliance syndrome

Terrence Milazi
Terrence Milazi
494 Points

admitted = None

if age >= 13:

admitted = True

else:

admitted = False

Why isn't true under colons?