repl.it
@zed1/

Iterate pairwise

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
x =  1, 2, 3, 4, 5, 6
for x1, x2 in zip(x, x[1:]):
    print(f"x1={x1}, x2={x2}")