EN : This function is used to reproduce the operation of the basic ‘enumerated’ function. This reproduction was created to allow people to better understand the operation of the basic function.
FR : Cette fonction est utilisée pour reproduire le fonctionnement de la fonction ‘enumerated’ de base. Cette reproduction a été créée pour permettre aux gens de mieux comprendre le fonctionnement de la fonction de base.
def manual_enumerate(list:list): """ This function is used to reproduce the operation of the basic enumerated function. This reproduction was created to allow people to better understand the operation of the basic function. """ new_list = [] n = 0 for v in list: new_list.append((n, v)) n = n + 1 return new_list # --- Example of use --- exemple_list = ["exemple", "hello", "world", "hi"] result = manual_enumerate(exemple_list) print(result) print("\n\n----\n\n") for i, v in result: print("index =", i) print("value =", v) print("")