In this article you will learn about itertools.pairwise, how to use it, and how to generalise it.
If there is a 50% chance something will go wrong, then 9 times out of 10 it will.