input: Write a function to create a REST API in Python using Flask that can delete an item from a list. The API should have endpoints for retrieving the list of items and deleting an item by its name. If the item is successfully deleted, return a success message; otherwise, return an error message if the item is not found.
  from flask import Flask, request
  import json
  
  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})
  assert app.get_items() == json.dumps(["Apple", "Banana", "Orange"])
  assert app.delete_item("Banana") == json.dumps({"message": "Item successfully deleted."})
  assert app.get_items() == json.dumps(["Apple", "Orange"])
  assert app.delete_item("Grape") == json.dumps({"message": "Item not found."})
  assert app.get_items() == json.dumps(["Apple", "Orange"])
output: 
  @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})
  