Welcome to the Treehouse Community
Looking to learn something new?
Unable to turn admitted to none
I can not make admitted to none
The challenge isn't asking you to make "admitted" be "none". It's asking for an if/else statement that will update admitted from "None" to "True" or "False", depending on whether age is >= 13.
You can solve this Challenge with the following code:
admitted = None # The next line checks if the 'age' variable, which we can't see, if greater than or or equal to 13. if age >= 13: # Then we assign True to the 'admitted' variable as the result of the 'if' statement being true. admitted = True # Part 2 of the Challenge asks for an 'else' code block; else: # If the age being greater or equal to 13 is not true, then the below code will be executed. admitted = False
Please let me know if you have any questions about this!
When I copy your code directly, it accepts what is written.
However when I do everything manually, even when I input identical code to yours, it declines and says Task 1 is no longer passing:
admitted = None if age >= 13: admitted = True else: admitted = False
edit: found that when I removed spaces in front of else it accepted what I wrote.
Many thanks for the quick help ! Was my first time being stuck & posting here, didn't quite know how to post code here properly yet.