input: Write a function that converts a linked list, represented by the ListNode class, into a Python list. The function should return the Python list containing all the data values from the nodes of the linked list in the order they appear.
  class ListNode:
      def __init__(self, data):
          self.data = data
          self.next = None
  
  assert linked_list_to_list(ListNode(1, ListNode(2, ListNode(3)))) == [1, 2, 3]
  assert linked_list_to_list(ListNode(5, ListNode(10))) == [5, 10]
  assert linked_list_to_list(ListNode(7)) == [7]
  assert linked_list_to_list(None) == []
output: def linked_list_to_list(head):
      result = []
      current = head
      while current:
          result.append(current.data)
          current = current.next
      return result