How can I simplify my Python code to compare two lists for three consecutive matching items

visit shbcf.ru