I am having difficulty wrapping my brain around the point of the expression vs the code block. What am I suppose to be defining? I copied the example from calculate value in the ArcGIS help website almost verbatim and yet it says my definition is wrong. More specifically it says a syntax error in line 1.
In your code block you are defining a function, in your expression you are calling that function. Your function needs to specify new variable names that are used within the function, and you pass the field names to those variables. The function variables should have new unique names, not the same values you are passing in your expression.
def fn(zs, zt): if zs => 0: return zs else: return zt
So here you are passing the value from
!Z_score! to your function into a variable called
zs, and the value from
zt. Those values are then used in the function.
And as commented by Michael Stimson, leave the Data Type as blank as
Boolean is unlikely to be the correct value.