I was looking at this answer, which shows how to identify if the list has any consecutive equal elements.
In a given list lst = [1, 2, 3, 4, 5, 5, 6]
any(i==j for i,j in zip(lst, lst[1:]))
will return True since two 5s are equal neighbors. However, this piece of code checks for any consecutive equal elements.
How do I change this code to check for a specific element, say 5, in the given list?