Ask coding questions

← Back to all posts
Why does this program have a problem
madmonster (8)

For some random reason, line 16 doesn't work (could be multiple lines of code with the same problem) and I have proof-readed it to my best shot and it had an error image saying that the syntax is incorrect even though the program looked as if it is completely errorproof. Please help!

Commentshotnewtop
themaka (181)

The others have already answered, but just to make sure it's clear. Using a single equal sign means you are setting a value.
x = 5

When you want to compare, like in an if statement, you have to use two equal signs
if x == 5:
#do something

AzureScripts (153)

You did it wrong!

You need to have 2 equal signs (==) when you are doing 'if' stuff

if thing1 == "A":

  # do stuff here
madmonster (8)

@AzureScripts But I have done it and it still has the error message!

Geocube101 (379)

If conditional requires two equal signs

if this == that:
  #Do This