Solving the Problem given to Nathan from the Movie X+Y in Python

Nathan Problem from X+Y Movie: Twenty random cards are placed in a row all face down. A turn consists of taking two adjacent cards where the left one is face down and the right one can be face up or face down and flipping them both. Show that this process must terminate