input: Write a function to create a REST API in Python that can be used to delete an item from a list. Use the Flask framework and ensure that the API handles both GET and DELETE methods. The function should define the necessary routes and handle the request logic appropriately.
  
  from flask import Flask, request
  import json
  
  def create_delete_item_api():
   app = Flask(__name__)
   items = ["Apple", "Banana", "Orange"]
  
   @app.route('/items', methods=["GET"])
   def get_items():
    return json.dumps(items)
  
   @app.route('/items/<item>', methods=["DELETE"])
   def delete_item(item):
    if item in items:
     items.remove(item)
     message = "Item successfully deleted."
    else:
     message = "Item not found."
    return json.dumps({"message": message})
   return app
  
  assert 'delete_item' in dir(create_delete_item_api())
  assert 'get_items' in dir(create_delete_item_api())
output: 
  def create_delete_item_api():
   app = Flask(__name__)
   items = ["Apple", "Banana", "Orange"]
  
   @app.route('/items', methods=["GET"])
   def get_items():
    return json.dumps(items)
  
   @app.route('/items/<item>', methods=["DELETE"])
   def delete_item(item):
    if item in items:
     items.remove(item)
     message = "Item successfully deleted."
    else:
     message = "Item not found."
    return json.dumps({"message": message})
   return app
  