I'm trying to perform a selection in an attribute table based on two columns. The intital step I'm intending to perform is to select fields between values, e.g. (a > 0 and a < 10) and from this selection then in the second step find fields in another column, e.g. (if b == 1, return "OK" elif b == 2, return "NOT OK"). I think I'm safe with the logic behind it, but the Python scripting seems to be my drawback. What Am I doing wrong since I get parsing error everytime I try to execute the code?
def Check ( a, b ):
for (a > 0) and (a < 10):
if b == 2:
return "NO"
elif b == 1:
return "YES"
elif b == 0:
return "MAYBE"
for (a => 10) and (a < 15):
if b == 2:
return "NO"
elif b == 1:
return "YES"
elif b == 0:
return "MAYBE"
for (a > 15):
if b == 2:
return "YES"
elif b == 1:
return "NO"
elif b == 0:
return "MAYBE"
Result (Check)