1

I am trying to define a function in pre-logic script code on ArcGIS 10.8. While running it, it shows the failure. I am not able to figure out the reason behind it.

I have defined the following function:

def no_mons(mon_in):
    if (mon_in<0.8 and mon_in>0):
        return 222

enter image description here

Error screenshot

The code block shows the following error-

ERROR 000989 Python syntax error: Parsing error SyntaxError: invalid syntax (line 1)

14
  • 1
    Screenshot of Geoprocessing result?
    – riflo
    Commented Jul 5, 2021 at 19:04
  • It did change a few rows but not the all
    – lsr729
    Commented Jul 5, 2021 at 19:05
  • if you input field is (integer,double,float) it should work correctly, i see no error in your code.
    – riflo
    Commented Jul 5, 2021 at 19:08
  • The input field is float, but its not wotking
    – lsr729
    Commented Jul 5, 2021 at 19:11
  • than open geoprocessing result, expand the task, right click to the "Message" and check the problem occurred. If you havnt done already
    – riflo
    Commented Jul 5, 2021 at 19:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.