human
Solve in Python:
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.

Example 1:

Input: 1->2->3->3->4->4->5
Output: 1->2->5

Example 2:

Input: 1->1->1->2->3
Output: 2->3

=====
Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.

# Definition for singly-linked list.
 # class ListNode:
 #     def __init__(self, x):
 #         self.val = x
 #         self.next = None
 
 class Solution:
     def deleteDuplicates(self, head):
         """
         :type head: ListNode
         :rtype: ListNode
         """
         if head == None:
             return None
         
         loop = head
         loop1 = head
         d = {}
         
         while loop:
             if loop.val in d.keys():
                 d[loop.val] += 1
             else:
                 d[loop.val] = 1
             loop = loop.next
         
         while loop1.next:
             if d[loop1.next.val] > 1:
                 loop1.next = loop1.next.next
             else:
                 loop1 = loop1.next
                 
         if d[head.val] > 1:
             return head.next
         else:
             return head