Python raises SyntaxError on “=” in if statement [closed]

The equality comparison operator in Python is ==. = is a statement for assigning a value to a variable.

Your code has a number of other errors (beginning with the undefined names num1, num2, sitting there doing nothing at the beginning). You should read the Python tutorial to brush up on the basics of Python syntax.

Leave a Comment