To solve **SyntaxError: cannot assign to operator** error follow below methods. A mathematical operator cannot be assigned the outcome of a calculation. You’ll get the SyntaxError: cannot assign to operator error if you complete a computation before an assignment operator appears on a line of code.

**ERROR LOG**

`SyntaxError: cannot assign to operator`

Contents

### How to solve SyntaxError: cannot assign to operator ?

When you try to evaluate a mathematical statement before an assignment operator, you get the SyntaxError: cannot assign to operator error.

To correct this error, ensure that all variable names are on the left side of an assignment operator and all mathematical statements are on the right.

Hope the above solution works.

**Also read :**

TypeError: descriptor ‘date’ for ‘datetime.datetime’ objects doesn’t apply to a ‘int’ object