input: Write a python function to count the number of nodes in a linked list.
  assert count_nodes(linked_list) == 3
  assert count_nodes(LinkedList()) == 0
  linked_list2 = LinkedList()
  linked_list2.head = Node(10)
  assert count_nodes(linked_list2) == 1
output: class Node:
      def __init__(self, data=None):
          self.data = data
          self.next = None
  
  class LinkedList:
      def __init__(self):
          self.head = None
  
  def count_nodes(linked_list):
      count = 0
      current = linked_list.head
      while current:
          count += 1
          current = current.next
      return count