input: Write a python function to reverse a singly linked list.
  assert reverse_linked_list(SinglyLinkedList().insert(1).insert(2).insert(3)).print_list() == [1, 2, 3]
  assert reverse_linked_list(SinglyLinkedList().insert(4).insert(5).insert(6)).print_list() == [4, 5, 6]
  assert reverse_linked_list(SinglyLinkedList().insert(7).insert(8).insert(9)).print_list() == [7, 8, 9]
output: class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
  
  class SinglyLinkedList:
      def __init__(self):
          self.head = None
  
      def insert(self, data):
          new_node = Node(data)
          new_node.next = self.head
          self.head = new_node
          return self
  
      def print_list(self):
          result = []
          current = self.head
          while current:
              result.append(current.data)
              current = current.next
          return result
  
  def reverse_linked_list(sll):
      prev = None
      current = sll.head
      while current:
          next_node = current.next
          current.next = prev
          prev = current
          current = next_node
      sll.head = prev
      return sll