Hello I have a loop in which if the statement is TRUE I want to delete the last element and add the new. I am posting a part of the code because as many times I tried it, still it doesn't delete the shp and the rasters. Any help is much appreciated. Thanks
elif arithmos >= valueslist[num_pnts2 - 1]: OM = n - 1 #VIEWSHED = "view" + str(OM) #POINT = "point" + str(OM) + ".shp" arcpy.Delete_management("point" + str(OM) + ".shp", "") arcpy.Delete_management("view" + str(OM), "")
In a few words at this part of the code, the last element will be for n=4 ,view4 and I want to delete the (OM = 4-1 => OM = 3) view3.