input: 
  from typing import Optional
  
  class Node:
      """Node class to represent a node in a linked list"""
      def __init__(self, data):
          self.data = data
          self.next = None
  
  class LinkedList:
      """LinkedList class to represent an entire linked list"""
      def __init__(self):
          self.head = None
      
      def print_list(self):
          """Print the data of each node in the linked list"""
          node = self.head
          while node:
              print(node.data)
              node = node.next
  
      def search(self, data) -> Optional[Node]:
          """Search for a node with the given data in the linked list.
          If found, return the node; otherwise, return None.
          >>> linked_list = LinkedList()
          >>> node1 = Node(1)
          >>> node2 = Node(2)
          >>> node3 = Node(3)
          >>> linked_list.head = node1
          >>> node1.next = node2
          >>> node2.next = node3
          >>> linked_list.search(2) is node2
          True
          >>> linked_list.search(4) is None
          True
          """
          current = self.head
          while current:
              if current.data == data:
                  return current
              current = current.next
          return None
  
  
output:     current = self.head
      while current:
          if current.data == data:
              return current
          current = current.next
      return None