I am attempting a field calculation that searches multiple fields for a specific string, in this case: apple. The string could be in any of the fields (Spring, Summer, Fall, Winter). I want to return just one instance of the string in a new field.
The problem I am having is that the Code Block does not like my syntax for a range of fields. See below for what is not working:
Expression
where(!Spring!)(!Summer!)(!Fall!)(!Winter!)
Code Block
def where(Spring)(Summer)(Fall)(Winter):
if ('apple' in (Spring)(Summer)(Fall)(Winter)):
return (Spring)(Summer)(Fall)(Winter)
else:
return None