Page 213 -
P. 213

custom data objects



                        Test Drive




                       Let’s run this code in IDLE and see what happens.












                                                                                        Your latest code










                                                                                             This output
                                                                                              is much more
                                                                                              understandable.




















           This program works as expected, and is fine…except that you have to name and create
           Sarah’s three variables in such as way that it’s possible to identify which name, date of birth,
           and timing data relate to Sarah. And if you add code to process the data for James, Julie,
           and Mikey, you’ll be up to 12 variables that need juggling. This just about works for now
           with four athletes. But what if there are 40, 400, or 4,000 athletes to process?
          Although the data is related in “real life,” within your code things are disjointed, because
           the three related pieces of data representing Sarah are stored in three separate variables.


                                                                                      you are here 4    177
   208   209   210   211   212   213   214   215   216   217   218