What is wrong with my code to remove duplicates from Linked List?
<p>New to Python and my code is passing all test cases other than input 1-->0, which it returns nothing instead of 1->0. does this have something to do with the value of None?</p>

<pre><code>def RemoveDuplicates(head):
    if head == None or head.next == None:
        return 
    else:
        temp = head
        while(temp.next != None):
            if temp.data == temp.next.data:
                temp.next = temp.next.next
            else:
                temp = temp.next
        return head
</code></pre>

<p>Try <code>is None</code> instead of <code>== None</code>.  Comparisons to singletons should be done using <code>is</code> or <code>is not</code>.</p>

python