if ([A1] == [B1] and [A2] == [B2]): output = "A AND B IDENTICAL" else: output = "OK"
output
If you are going to use Python to calculate fields with lots of logic then it is much easier to use an UpdateCursor. The FieldCalculator wraps a cursor around your expression anyway so it is the same thing. I regard the FieldCalculator as a prop to use in ModelBuilder only.
The benefits of using a cursor are many:
with arcpy.da.UpdateCursor(feature_class,['A1',' B1',' A2', 'B2',' C']) as cur: for row in cur: if (row[0] == row[1] and row[2] == row[3]): row[4] = "A AND B IDENTICAL" else: row[4] = "OK" cur.updateRow(row)