input: Write a function to delete a node from a singly linked list given the head of the list and the node to be deleted. The function should return the head of the modified linked list. If the node to be deleted is not found, the list should remain unchanged.
  
  class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
  
  class LinkedList:
      def __init__(self):
          self.head = None
  
      def deleteNode(self, node):
          temp = self.head
          if temp is not None:
              if temp == node:
                  self.head = temp.next
                  temp = None
                  return self.head
          while temp is not None:
              if temp == node:
                  break
              prev = temp
              temp = temp.next
          if temp == None:
              return self.head
          prev.next = temp.next
          temp = None
          return self.head
  
  # Test cases
  # Helper function to create a linked list from a list of values
  def createLinkedList(values):
      ll = LinkedList()
      if not values:
          return ll
      ll.head = Node(values[0])
      current = ll.head
      for value in values[1:]:
          current.next = Node(value)
          current = current.next
      return ll
  
  # Helper function to print the linked list
  def printLinkedList(ll):
      current = ll.head
      while current:
          print(current.data, end=" -> ")
          current = current.next
      print("None")
  
  # Test case 1
  ll1 = createLinkedList([1, 2, 3, 4, 5])
  node_to_delete1 = ll1.head.next.next  # Node with value 3
  assert printLinkedList(ll1) == "1 -> 2 -> 4 -> 5 -> None"
  
  # Test case 2
  ll2 = createLinkedList([10, 20, 30, 40])
  node_to_delete2 = ll2.head.next.next.next  # Node with value 40
  assert printLinkedList(ll2) == "10 -> 20 -> 30 -> None"
  
  # Test case 3
  ll3 = createLinkedList([5, 10, 15])
  node_to_delete3 = Node(20)  # Node that doesn't exist in the list
  assert printLinkedList(ll3) == "5 -> 10 -> 15 -> None"
  
  # Test case 4
  ll4 = createLinkedList([1])
  node_to_delete4 = ll4.head  # Node with value 1
  assert printLinkedList(ll4) == "None"
  
  # Test case 5
  ll5 = createLinkedList([])
  node_to_delete5 = None
  assert printLinkedList(ll5) == "None"
output: def deleteNode(self, node):
      temp = self.head
      if temp is not None:
          if temp == node:
              self.head = temp.next
              temp = None
              return self.head
      while temp is not None:
          if temp == node:
              break
          prev = temp
          temp = temp.next
      if temp == None:
          return self.head
      prev.next = temp.next
      temp = None
      return self.head