Why add cur_node in if statement (delete node function)

I would like to understand why you check if cur_node equals to True in your if statement.
It seems the code would work just fine with just:
if == key:

Thanks a lot
Best regards

def delete_node(self, key):

cur_node = self.head

if cur_node and == key:
self.head =
cur_node = None

Course: Data Structures and Algorithms in Python - Learn Interactively
Lesson: Deletion by Value - Data Structures and Algorithms in Python

Hi @Guillaume_Besson,
As mentioned in the lesson we use if cur_node and == key statement to handle the case of deleting the head.
I hope it will help. Please drop us a note if you have any other questions or concerns.