Skip to content

Commit 7779103

Browse files
committed
fix: problems in 06_linkedlist/singlyLinkedList.py
1 parent 1556c4a commit 7779103

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/06_linkedlist/singlyLinkedList.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def delete_by_node(self, node):
146146
not_found = False # 如果在整个链表中都没有找到指定删除的Node节点,则该标记量设置为True
147147
while pro.next != node:
148148
if pro.next == None: # 如果已经到链表的最后一个节点,则表明该链表中没有找到指定删除的Node节点
149-
not_found == True
149+
not_found = True
150150
break
151151
else:
152152
pro = pro.next
@@ -169,7 +169,7 @@ def delete_by_value(self, value):
169169
not_found = False
170170
while node.data != value:
171171
if node.next == None: # 如果已经到链表的最后一个节点,则表明该链表中没有找到执行Value值的Node节点
172-
not_found == True
172+
not_found = True
173173
break
174174
else:
175175
pro = node

0 commit comments

Comments
 (0)