Hello! I am very very new to Python and am needing help creating a script for Field Calculator and am having trouble finding an online resource- hoping someone here could help me! I created a script that populates a new field based off of existing attributes in an existing field but am needing to add a caveat that if another case is true, then this other condition supersedes all other conditions.
ie I currently have something along the lines of:
def Reclass(field1):
if (field 1=='x'):
return "1"
if (field 1 =='y'):
return "2"
else:
return "3"
But I want to add something that says that no matter what is in field 1, if field 2 == y, return 4: a condition to supersede all the other conditions.
Thanks in advance!