Skip to main content
1 of 3
radouxju
  • 49.9k
  • 2
  • 71
  • 144

Your main problem is the use of "for" instead of "if" with the conditionals related to the first field.

def Check ( a, b ):
 if (a > 0) and (a < 10):
  if b == 2:
   return "NO"
  elif b == 1:
   return "YES"
  elif b == 0:
   return "MAYBE" 
 elif (a => 10) and (a < 15):
  if b == 2:
   return "NO"
  elif b == 1:
   return "YES"
  elif b == 0:
   return "MAYBE"
 elif (a > 15):
  if b == 2:
   return "YES"
  elif b == 1:
   return "NO"
  elif b == 0:
   return "MAYBE"

Also, make sure that you run it with

Check(!fielda!,!fieldb!)
radouxju
  • 49.9k
  • 2
  • 71
  • 144