The screenshot shows a calculate field tool in modelbuilder. The error I'm getting is invalid syntax line 1. I can't see any issues w/the syntax so I'm hoping someone out there can help. It calculates field A to equal field B if field A is not equal to field B.
Your variable names cannot have a dot (.) in it. Simply change your function to the following:
def update(field1, field2): if field1 != field2: return field2: else: return field1
Python has some conventions for variable names. You can use any letter, the special characters “_” and every number provided you do not start with it. White spaces and signs with special meanings in Python, as “+” and “-” are not allowed.