This is my code:
def dn(self,x):
curr = self.head
while curr is not None:
if(curr==x):
break
curr=curr.next
prev= curr
temp = curr.next
prev.next= temp
return self.head
I get this error:
AttributeError: 'NoneType' object has no attribute 'next'
What is my mistake?