I am very new to Python and need what I believe is a very basic script in order for my field to represent another fields' input, if the field's value is 0. I tried to search for this, but gave up after two hours... I am currently trying the script on two fields that I made only for this purpose, using ArcGIS 10.0. So what I want to do is returning the value of field "TESTFIELDBEREGNER" in "TESTFIELD" IF TESTFIELD=0, else return TESTFIELD. I believe the error may lie in the definition, as I don't know how to define strings in this correctly? The geoprocessing results window tells me there is a syntax error in line 2.
def RemoveNULLS(x, v): if x == '0' return v else: return x RemoveNULLS( !TESTFIELD!, !TESTFIELDBEREGNER!)