Page 110 -
P. 110

textual data


                            Your Programming Toolbox


                            You’ve got Chapter 2 under your
                            belt. Let’s look back at what you’ve
                            learned in this chapter:                                                            CHAPTER 2

           Programming T ools



            * Strings are sequences of individual characters.
            * Individual string characters are referenced by index.

            * Index values are offsets that start from zero.
             * Methods provide variables with built-in functionality.

             * Programming libraries provide a collection of related

              pre-built code and functions.
              * As well as having a value, data in variables also have a


              “data type."                              Python T ools
              * Number is a data type.
               * String is a data type.                * s[4] - access the 5th character of the variable “s",

                                                       which is a string


                                                      * s[6:12] - access a sub-string within the string “s" (up
                                                      to, but not including)
                                                      *s.find() method for searching strings

                                                     * s.upper() method for converting strings to
                                                     UPPERCASE


                                                     * float() converts strings to decimal point numbers
                                                     known as “floats"
                                                    * + addition operator
                                                    * > greater than operator


                                                   * urllib.request library for talking to the Web
                                                   * time library for working with dates/time



                                                                                        you are here 4    75
   105   106   107   108   109   110   111   112   113   114   115