while len(file) > 0: S = file.pop(0) # Utilise pop(0) pour défiler if S not in sortie: sortie.append(S) unvisited = [n for n in G[S] if n not in sortie] file.extend(unvisited) print(sortie)