I am having issues with loops and if statements in python. I keep getting an error on the last line. What am I doing wrong?
import arcpy
from arcpy.sa import *
from arcpy import env
sorder=r"C:\Temp\ARCGIS_PROJECT\Tutorial\Final\layers\streamorder"
desc= arcpy.Describe(sorder)
xmin= desc.extent.XMin
ymin=desc.extent.YMin
xmax= desc.extent.XMax
ymax= desc.extent.YMax
count= 0
for columns in range (xmin, xmax):
pointval= arcpy.GetCellValue_management(sorder,"%s %s" % (columns++,ymin), "1")
if (pointval== 1, pointval==2, pointval==3):
count++
print "count= %s" % (count)
You need to have consistent spacing when indenting for and if statements. Your for statement is indented 2 spaces, while your if statement is indented 4 spaces from the for statement when it should be 2. Just make sure they are consistent, and that you aren't mixing spaces and tabs.
https://www.python.org/dev/peps/pep-0008/