input: Write a function that describes a task and provides an appropriate response to complete the request. The task is to create a doubly linked-list in Python that can traverse in both directions. Implement a Node class and a DoubleLinkedList class with methods to append, prepend, and reverse the list.
  
  
  Write a function to describe a task and provide an appropriate response to complete the request. The task is to create a doubly linked-list in Python that can traverse in both directions. Implement a Node class and a DoubleLinkedList class with methods to append, prepend, and reverse the list.
  
output: class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
          self.prev = None
  
  class DoubleLinkedList:
      def __init__(self):
          self.head = None
          self.tail = None
  
      def append(self, data):
          new_node = Node(data)
          if self.head is None:
              self.head = new_node
              self.tail = new_node
          else:
              new_node.prev = self.tail
              self.tail.next = new_node
              self.tail = new_node
  
      def prepend(self, data):
          new_node = Node(data)
          if self.head is None:
              self.head = new_node
              self.tail = new_node
          else:
              new_node.next = self.head
              self.head.prev = new_node
              self.head = new_node
  
      def reverse(self):
          current = self.head
          while current:
              current.next, current.prev = current.prev, current.next
              current = current.prev
          self.head, self.tail = self.tail, self.head