input: Write a python function to detect a cycle in a linked list.
  assert detect_cycle(node1) == True  # Assuming node1 is the head of a cyclic linked list
  assert detect_cycle(node2) == False  # Assuming node2 is the head of a non-cyclic linked list
  assert detect_cycle(None) == False  # Empty list should return False
output: def detect_cycle(head):
      if head is None:
          return False
  
      slow = head
      fast = head
  
      while fast is not None and fast.next is not None:
          slow = slow.next
          fast = fast.next.next
  
          if slow == fast:
              return True
  
      return False