Amitesh Kumar552 Points
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
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.
admitted = None age = 13 if (age >= 13) : admitted = True
Jason AndersTreehouse Moderator 143,823 Points
You're on the right track. There are just a few small things:
- The instructions stated that it is going to "create a variable named age", so you shouldn't. You will need to delete that line of code.
- In python, parentheses are not required for an
if statement, so remove those.
- There is a space before the colon (:) that is beginning the
if blockand that is causing a syntax error.
admitted = None if age >= 13: admitted = True
Remember, that instructions for challenges are very specific and always need to be followed exactly or the challenge will fail.
Keep Coding! :)
Moderator note: I did delete the "answer" you added with unformatted code. The code block was included when you posted the question. If you do need to, in the future, add some more code, please use the Markdown Cheetsheet (link above the post button) to properly format code for the Community. You can also take the Markdown Basics Course. Markdown is very useful. Without it, may things (especially here in the Community) become unreadable.