From faa699afbe72216e38d7f75c99595c01990f1752 Mon Sep 17 00:00:00 2001 From: Gautam Manek Date: Thu, 3 Mar 2022 17:09:14 +0100 Subject: [PATCH] fix: removed code from main to doctest --- data_structures/linked_list/has_loop.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/data_structures/linked_list/has_loop.py b/data_structures/linked_list/has_loop.py index bc06ffe150e8..4f2e04cdbfa6 100644 --- a/data_structures/linked_list/has_loop.py +++ b/data_structures/linked_list/has_loop.py @@ -41,22 +41,3 @@ def has_loop(self) -> bool: return False except ContainsLoopError: return True - - -if __name__ == "__main__": - root_node = Node(1) - root_node.next_node = Node(2) - root_node.next_node.next_node = Node(3) - root_node.next_node.next_node.next_node = Node(4) - print(root_node.has_loop) # False - root_node.next_node.next_node.next_node = root_node.next_node - print(root_node.has_loop) # True - - root_node = Node(5) - root_node.next_node = Node(6) - root_node.next_node.next_node = Node(5) - root_node.next_node.next_node.next_node = Node(6) - print(root_node.has_loop) # False - - root_node = Node(1) - print(root_node.has_loop) # False