Exercise 1

def find_dups(list):

""" (list) -> set
 Return the number of duplicates numbers from a list.
 Use the fact that sets does not accept duplicates.
 Length of a set remains the same when trying the add
 an already existing element.
 >>>find_dups([1,1,2,3,4,2])
 {1,2}
 >>>find_dups([1,2,3,4])
 set{}
""" 
elem_set = set()
dups_set = set()
for entry in list:
    len_initial = len(elem_set)
    elem_set.add(entry)
    len_after = len(elem_set)
    if len_initial == len_after:
        dups_set.add(entry)
return(dups_set)