Welcome to the Treehouse Community
Looking to learn something new?
why is task one no longer satisfying
why is this code wrong?
admitted = None if age >= 13: admitted = True age = 12 if age >= 13: admitted = True else: admitted = False
Steven Merriel2,563 Points
Hello Priyanka, I believe there are a couple of things that will assist your code to run.
- Currently you are testing age to see if it is greater than 13 twice, I think what you would like to do is if they are above 13 set 'admitted' to True if they are younger then set it to false. This can be achieved with a smaller amount of code and just one if statement
python admitted = None if age >= 13: admitted = True age = 12 else: admitted = False
- Please note that the else statement should be inline with the if statement. In your code it is indented and this will mean that it won't run
I hope this helps