input: Write a function to implement a REST API in Python that can be used to delete an item from a list. The function should have a route for deleting an item, which checks if the item exists in the list and if so, removes it and returns a success message. If the item does not exist, it should return a not found message. If the input list is empty, it should still be able to handle the DELETE operation and return a not found message.
  assert delete_item("Banana")==json.dumps({"message": "Item successfully deleted."})
  assert delete_item("Grapes")==json.dumps({"message": "Item not found."})
  assert delete_item("")==json.dumps({"message": "Item not found."})
  assert delete_item("Apple")==json.dumps({"message": "Item successfully deleted."})
  assert delete_item("Apple")==json.dumps({"message": "Item not found."})
  from flask import Flask, request
  import json
  
  app = Flask(__name__)
  items = ["Apple", "Banana", "Orange"]
  
  @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})
output: 
  @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})
  