Page 144 -
P. 144

functions



                     Test Drive





           The fixed version of the code has been loaded onto machines
           in every Starbuzz store worldwide. It’s time to try out the code
           and see if you can get the ordering system working again:


























                          Sure enough, the emergency
                          order price gets through.










           It works! Because you are creating the password outside
           of a function, it is available globally throughout the Python
           program file. The password variable will be recorded against
           the initial stack frame, so the send_to_twitter() function
           will now be able to see it.

           Let’s see how the updated code is affecting
           the rest of Starbuzz.





                                                                                       you are here 4    109
   139   140   141   142   143   144   145   146   147   148   149