Obtenez le prochain élément pendant la boucle
arr = [1,2,3,4]
arr = iter(arr)
for x in arr:
print(x, next(arr))
CodeHunter
arr = [1,2,3,4]
arr = iter(arr)
for x in arr:
print(x, next(arr))