Before I give away the ranch with a dash of code. Is it possible that the Code Magnets scramble on page 20 have a certain line of code that needs to be duplicated to get the proper output?
You are correct. One of the magnets needs to be used twice in order to produce the correct results. This is not reflected in the solution shown on page 25. (Entering the code on pg 20 does result in incorrewct ouput). The "problem" then becomes by reusing that one magnet, the while loop beomces unneccessary since you only "loop" through it one time.