From f89d3a9ec3f4686b22251c8e05e02773727c3937 Mon Sep 17 00:00:00 2001 From: Ashwek Swamy <39827514+ashwek@users.noreply.github.com> Date: Thu, 1 Nov 2018 21:25:45 +0530 Subject: [PATCH] Update singly_linked_list.py --- data_structures/linked_list/singly_linked_list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data_structures/linked_list/singly_linked_list.py b/data_structures/linked_list/singly_linked_list.py index a19e05fe9..0b9e44768 100644 --- a/data_structures/linked_list/singly_linked_list.py +++ b/data_structures/linked_list/singly_linked_list.py @@ -12,7 +12,7 @@ class Linked_List: self.Head = None # Initialize Head to None def insert_tail(self, data): - if(self.Head == None): self.insert_head(data) #If this is first node, call insert_head + if(self.Head is None): self.insert_head(data) #If this is first node, call insert_head else: temp = self.Head while(temp.next != None): #traverse to last node @@ -50,7 +50,7 @@ class Linked_List: return tamp def isEmpty(self): - return self.Head == None # Return if Head is none + return self.Head is None # Return if Head is none def reverse(self): prev = None