I have a feature class within a geodatabase that has a field called 'cellnum' and also, by default, has an OID field. I am trying to create an Update Cursor that will read the OID number, take the last digit, subtract it by 1, and add that value to the field 'cellnum'. So, if the OID is 614, the cellnum value should be 3-- last digit of 614 is 4, minus 1 is 3).I have something like this already:sort = "C:/User/Username/Documents/project/ABE.gdb/cellanalysis_Sort1"
rows3 = arcpy.UpdateCursor(sort)
for row3 in rows3:
fUpdate = arcpy.Describe(sort)
num = row3.getValue("ID")
OID = fUpdate.OIDFieldName
value = row3.getValue(OID)
digit = value[-1] - 1
print "for ID:" + str(num) + " the cellnum is " + digit
del row3,rows3
However, python doesn't like my 'digit' statement. Can anyone shed some light on this?Thanks!