input: Write a python function to reverse a linked list.
  ```python
  class Node: 
      def __init__(self, data): 
          self.data = data 
          self.next = None 
  
  class LinkedList: 
      def __init__(self): 
          self.head = None 
  
      def reverse(self): 
          prev = None
          current = self.head 
          while(current is not None): 
              next = current.next
              current.next = prev 
              prev = current 
              current = next
          self.head = prev 
          return self.head
  
  def test_reverse_linked_list():
      ll = LinkedList()
      ll.head = Node(1)
      second = Node(2)
      third = Node(3)
      ll.head.next = second
      second.next = third
      
      ll.reverse()
      assert ll.head.data == 3
      assert ll.head.next.data == 2
      assert ll.head.next.next.data == 1
      assert ll.head.next.next.next == None
  
      ll2 = LinkedList()
      ll2.head = Node(1)
      ll2.reverse()
      assert ll2.head.data == 1
      assert ll2.head.next == None
  
  test_reverse_linked_list()
output: def reverse(self): 
      prev = None
      current = self.head 
      while(current is not None): 
          next = current.next
          current.next = prev 
          prev = current 
          current = next
      self.head = prev 
      return self.head