Ask coding questions

← Back to all posts
I can't figure out how to make this work! :(
CrafttheWorld (0)

I can't make the if else statement work. I've looked at my other codes but still can't figure it out. I think if else statements always get me. :(

Comments
hotnewtop
Coder100 (19280)

Your syntax is indeed slightly wrong. If statements are statements like anything else, so they don't need to be indented! Here is the syntax:

for you:

I put your input into a variable instead of an if statement because it's more maintainable that way. Also, input is a function that takes an argument to print to the screen, not to compare! Use == for that.

CrafttheWorld (0)

Thank you @Coder100. I will try it out.