Please find below the required source code:
for j in range(len(mynums) - 1):
if mynums[j] == 2 and mynums[j+ 1] == 2:
This was the easiest solution that I came up with.
Using the for loop to check if the iterated number, mynums[j] == 2 "and" the one very next to it, which is [j+1] == 2 as well.
Here (len(mynums)-1): this line will just prevent it from going out of the range through the for loop as the j+1 on the final loop will check out of the range.
I hope you have clearly understood the solution given to you by me.