Page 160 -
P. 160

data in files and arrays



                     Test Drive




           So what happens when you run this version of the code within IDLE ? Let’s
           amend the code and see:



                                                                  The amended code, which
                                                                  takes advantage of the
                                                                  split() method.















         This time, the program
          produces a result you
          can actually use.





           It works! The program reads each line from the file as a string, extracts the
           score using the split() method, and then uses it to find the highest score
           in the file. The organizers are so excited to hear that the program is finished
           that they immediately display the result on the large scoreboard at the back
           of the beach.

                   The results are in!
                   Or are they... ?             Surf-A-Thon
                                                                                          Ummm ... those are
                                                   1.     9.12                            the top scores?!?!

                                                   2.     ???
                                                   3.     ???






                                                                                       you are here 4    125
   155   156   157   158   159   160   161   162   163   164   165