Page 170 -
P. 170

data in files and arrays



                     Test Drive




           The program should now store all of the information from the file into
           the scores array before displaying just the top three scores. Let’s run
           the program within IDLE and see what happens:























       The code produces these
        results, which flash up on           Surf-A-Thon
        the scoreboard.
                                                1.     8.65

                                                2.     9.12

                                                3.     8.45         Cool, dude!
                                                                    That‛s my score...
                                                                    I can‛t believe I
                                                                    won.
           Crap. The program is printing out the 3 scores all right, but it’s not
           printing out the top 3 scores in order, and there’s confusion about who
           won.






                 Which important step did the program forget to perform?





                                                                                       you are here 4    135
   165   166   167   168   169   170   171   172   173   174   175