# Name: DeleteFeatures_Example2.py
# Description: Delete features from a feature class based on an expression
# Import system modules
# Set environment settings
arcpy.env.workspace = "C:/data/airport.gdb"
# Set local variables
inFeatures = "parcels"
outFeatures = "C:/output/output.gdb/new_parcels"
tempLayer = "parcelsLayer"
expression = arcpy.AddFieldDelimiters(tempLayer, "PARCEL_ID") + " = 'Cemetery'"
# Execute CopyFeatures to make a new copy of the feature class
# Execute MakeFeatureLayer
# Execute SelectLayerByAttribute to determine which features to delete
# Execute GetCount and if some features have been selected, then
# execute DeleteFeatures to remove the selected features.
if int(arcpy.GetCount_management(tempLayer)) > 0: