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

matthew augustine
matthew augustine
2,846 Points

how do I change Admitted to true without creating a new variable?

I am confused :(

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

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Matthew,

You're on the right track, but first off, the instructions say nothing about Printing a string, so I'm unsure as to why you have print("admitted") in your if statement. Note: Instructions for challenges are explicit and must be followed exactly, or you will get the Bummer even if syntax is correct and the code works. So, don't do anything they don't ask for; don't alter pre-loaded code (unless explicitly instructed to) and only do what is asked. Here, it is not to print, but rather to assign (or re-assign).

The instruction only ask you to change the variable to True if the if condition is met. Remember that just because a variable was declared earlier, does not mean you can't reassign a new value to the variable.

So you have the correct structure for the syntax and the indentation is correct, you just need to replace the print() method with a re-assignment admitted = True.

Other than that, nice work! :) :dizzy:

matthew augustine
matthew augustine
2,846 Points

yeah.. I was just made an assumption based off of the lesson which was my first mistake lol... I finally worked through it.. I know I was on the right track and probably overthinking it .. just needed to replace print with admitted = True. So obvious .. such a noob