Implement a generator that yields consecutive overlapping pairs from any iterable.
Constraints
Example
>>> list(pairwise([1, 2, 3]))
[[1, 2], [2, 3]]
>>> list(pairwise('abcd'))
[['a', 'b'], ['b', 'c'], ['c', 'd']]
>>> list(pairwise([1]))
[]
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints