Page 221 -
P. 221

custom data objects




                                                Actually, those review comments are really useful. Let’s take the time to
                                                apply them to your code. There are four suggestions that you need to
                                                adjust your code to support:
                                                1. Create the dictionary all in one go.
                                                2. Move the dictionary creation code into the get_coach_data()
                                                function, returning a dictionary as opposed to a list.
                                                3. Move the code that determines the top three times for each athlete
                                                into the get_coach_data() function.
                                                4. Adjust the invocations within the main code to the new version of the
                                                get_coach_data() function to support it’s new mode of operation.

                                                Grab your pencil and write your new get_coach_data() function
                                                in the space provided below. Provide the four calls that you’d make to
                                                process the data for each of the athletes and provide four amended
                                                print() statements:













































                                                                                      you are here 4    185
   216   217   218   219   220   221   222   223   224   225   226