Title of your comment'NoneType' object has no attribute 'next'


#1

Error at : while (A.next!=None):
class Solution:
# @param A : head node of linked list
# @return the head node in the linked list
def deleteDuplicates(self, A):

    if A==None or A.next==None:
        return A
    else:
        t=A
        while (A.next!=None):
            if A.val==A.next.val:
                A.next=A.next.next
                A=A.next
            else:
                A=A.next
        return t

#2
    curr = A
    while A :
        if curr is None or curr.next is None :
            break
        elif curr.val != curr.next.val : 
            curr = curr.next 
        else :
            temp = curr
            while (curr is not None and curr.next is not None and curr.val == curr.next.val) :
                curr = curr.next
            temp.next = curr.next
            curr = temp
    
    return A