Dapatkan elemen berikutnya saat melingkar
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))