[GIS] Using Range in Python expression of ArcGIS Field Calculator

arcgis-10.0arcgis-desktopfield-calculatorpython-parser

what is the python expression for defining a range of numbers?

I have tried numerous combinations but cannot get a simple range of angles (100 -200) to compute correctly.

Screen shot :

Range in Field Calculator needed

Best Answer

if !ET_Angle! > 100 and !ET_Angle! < 200

To be more complete, put this in the codeblock:

def LeftOrRight(value):
    if value > 100 and value < 200:
         return "LEFT"
    else:
         return "RIGHT"

And in the calculation area, just put:

LeftOrRight(!ET_Angle!)