import arcpy fc = 'C:\........\Einzelpunkt.shp' fields = ['Identifika'] #setting up the max value variables Zone1=0 Zone2=0 # For each row in the attribute table, use if statements # to determine which category it is in and if it is bigger # than the current max value for that category, update the # max value variable with arcpy.da.SearchCursor(fc, fields) as cursor: for row in cursor: if row[0]<20000 and row[0]>Zone1: Zone1=row[0] elif row[0]<30000 and row[0]>Zone2: Zone2=row[0] #keep adding elif statements to cover the rest of the Zones #this will print out the last number used in the Zone category print "Zone1="+str(Zone1) print "Zone2="+str(Zone2) break