def drop_tables(names, session):
 metadata = MetaData()
 metadata.reflect(bind=session.bind)
 for table in metadata.sorted_tables:
  if (table.name in names):
   table.drop()

def drop_tables ( names , session ) : metadata = MetaData ( ) metadata . reflect ( bind = session . bind ) for table in metadata . sorted_tables : if ( table . name in names ) : table . drop ( )
takes a list of table names and drops them from the database if they exist .