Python to select and delete multiple faces?
You can use bmesh and bmesh.ops to do it.

The code is commented below:

import bpy
import bmesh
from mathutils import Vector

def NormalInDirection( normal, direction, limit = 0.5 ):
    return direction.dot( normal ) &gt; limit

def GoingUp( normal, limit = 0.5):
    return NormalInDirection( normal, Vector( (0, 0, 1 ) ), limit )

def GoingDown( normal, limit = 0.5):
   return NormalInDirection( normal, Vector( (0, 0, -1 ) ), limit )

def GoingSide( normal, limit = 0.5):
    return GoingUp( normal, limit ) == False and GoingDown( normal, limit ) == False

obj = bpy.context.object

prevMode = obj.mode

# Will need to be in object mode
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

# Create a bmesh access
bm = bmesh.new()
bm.from_mesh( obj.data )

# Get faces access
bm.faces.ensure_lookup_table()

# Identify the wanted faces
faces = [f for f in bm.faces if GoingUp( f.normal ) or GoingDown( f.normal )]

# Delete them
bmesh.ops.delete( bm, geom = faces, context = 'FACES_ONLY' )

# Push the geometry back to the mesh
bm.to_mesh( obj.data )

# Back to the initial mode
bpy.ops.object.mode_set(mode=prevMode, toggle=False)