Apr-07-2020, 09:36 AM
(This post was last modified: Apr-07-2020, 09:36 AM by deanhystad.)
Unpack the list and check if the key value is already in the dictionary.
def check(seq): new_dict = {} for i in seq: (key, value), *rest = i.items() if value in new_dict: print("Numero en double! " + "---->" + value + " Fichier non utilisable!") else: new_dict[value] = dict(rest) return new_dictI don't know what you want to do for duplicated entries. The code above prints your message and excludes the duplicate entry.