SEESenv/web/html/ch3list_tuples.html
author amit@thunder
Thu, 25 Feb 2010 00:04:27 +0530
changeset 27 cb14131583c6
child 28 514098969b11
permissions -rw-r--r--
Started on final changes to the build scripts so that we can start with totally automatic builds
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
     1
<html>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
     2
 <head>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
     3
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
     4
  <title>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
     5
   Chapter. list_tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
     6
  </title>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
     7
  <link rel="stylesheet" href="/review/support/styles.css" type="text/css" />
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
     8
  <meta name="generator" content="DocBook XSL Stylesheets V1.74.3" />
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
     9
  <link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png" />
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    10
  <script type="text/javascript" src="/review/support/jquery-min.js">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    11
  </script>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    12
  <script type="text/javascript" src="/review/support/form.js">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    13
  </script>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    14
  <script type="text/javascript" src="/review/support/hsbook.js">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    15
  </script>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    16
 </head>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    17
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    18
  <div class="chapter" id="ch3list_tuples">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    19
   <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    20
   </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    21
   <div class="toc">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    22
    <p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    23
     <b>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    24
      Table of Contents
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    25
     </b>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    26
    </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    27
    <dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    28
     <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    29
      <span class="article">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    30
       <a href="#id2951820">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    31
        Lists and Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    32
       </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    33
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    34
     </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    35
     <dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    36
      <dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    37
       <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    38
        <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    39
         <a href="#id2761866">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    40
          1. Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    41
         </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    42
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    43
       </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    44
       <dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    45
        <dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    46
         <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    47
          <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    48
           <a href="#id2951624">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    49
            1.1. Common List Operations
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    50
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    51
          </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    52
         </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    53
         <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    54
          <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    55
           <a href="#id3003090">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    56
            1.2. None, Empty Lists, and Initialization
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    57
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    58
          </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    59
         </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    60
         <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    61
          <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    62
           <a href="#id3003130">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    63
            1.3. Nested Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    64
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    65
          </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    66
         </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    67
         <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    68
          <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    69
           <a href="#id3003165">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    70
            1.4. List Methods
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    71
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    72
          </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    73
         </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    74
        </dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    75
       </dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    76
       <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    77
        <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    78
         <a href="#id3003481">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    79
          2. Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    80
         </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    81
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    82
       </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    83
       <dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    84
        <dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    85
         <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    86
          <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    87
           <a href="#id3003578">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    88
            2.1. Common Tuple Operations
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    89
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    90
          </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    91
         </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    92
        </dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    93
       </dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    94
       <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    95
        <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    96
         <a href="#id3003727">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    97
          3. Additional Syntax
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    98
         </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
    99
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   100
       </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   101
       <dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   102
        <dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   103
         <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   104
          <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   105
           <a href="#id3003745">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   106
            3.1. range()
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   107
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   108
          </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   109
         </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   110
         <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   111
          <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   112
           <a href="#id3003777">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   113
            3.2. for
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   114
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   115
          </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   116
         </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   117
        </dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   118
       </dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   119
       <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   120
        <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   121
         <a href="#id3003836">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   122
          4. Conclusion
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   123
         </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   124
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   125
       </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   126
      </dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   127
     </dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   128
    </dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   129
   </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   130
   <div class="article" title="Lists and Tuples">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   131
    <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   132
     <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   133
      <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   134
       <h2 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   135
        <a name="id2951820">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   136
        </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   137
        Lists and Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   138
       </h2>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   139
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   140
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   141
     <hr />
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   142
    </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   143
    <div class="toc">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   144
     <p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   145
      <b>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   146
       Table of Contents
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   147
      </b>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   148
     </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   149
     <dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   150
      <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   151
       <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   152
        <a href="#id2761866">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   153
         1. Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   154
        </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   155
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   156
      </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   157
      <dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   158
       <dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   159
        <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   160
         <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   161
          <a href="#id2951624">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   162
           1.1. Common List Operations
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   163
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   164
         </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   165
        </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   166
        <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   167
         <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   168
          <a href="#id3003090">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   169
           1.2. None, Empty Lists, and Initialization
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   170
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   171
         </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   172
        </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   173
        <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   174
         <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   175
          <a href="#id3003130">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   176
           1.3. Nested Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   177
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   178
         </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   179
        </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   180
        <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   181
         <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   182
          <a href="#id3003165">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   183
           1.4. List Methods
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   184
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   185
         </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   186
        </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   187
       </dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   188
      </dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   189
      <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   190
       <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   191
        <a href="#id3003481">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   192
         2. Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   193
        </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   194
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   195
      </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   196
      <dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   197
       <dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   198
        <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   199
         <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   200
          <a href="#id3003578">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   201
           2.1. Common Tuple Operations
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   202
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   203
         </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   204
        </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   205
       </dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   206
      </dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   207
      <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   208
       <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   209
        <a href="#id3003727">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   210
         3. Additional Syntax
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   211
        </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   212
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   213
      </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   214
      <dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   215
       <dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   216
        <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   217
         <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   218
          <a href="#id3003745">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   219
           3.1. range()
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   220
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   221
         </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   222
        </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   223
        <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   224
         <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   225
          <a href="#id3003777">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   226
           3.2. for
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   227
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   228
         </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   229
        </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   230
       </dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   231
      </dd>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   232
      <dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   233
       <span class="section">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   234
        <a href="#id3003836">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   235
         4. Conclusion
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   236
        </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   237
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   238
      </dt>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   239
     </dl>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   240
    </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   241
    <div class="section" title="1.Lists">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   242
     <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   243
      <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   244
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   245
        <h2 class="title" style="clear: both">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   246
         <a name="id2761866">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   247
         </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   248
         1.Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   249
        </h2>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   250
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   251
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   252
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   253
     <p id="ch3list_tuples_1">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   254
      Python provides an intuitive way to represent a group items, called
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   255
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   256
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   257
        Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   258
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   259
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   260
      . The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   261
items of a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   262
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   263
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   264
        List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   265
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   266
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   267
      are called its elements. Unlike C/C++, elements can be of any
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   268
type. A
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   269
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   270
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   271
        List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   272
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   273
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   274
      is represented as a list of comma-sepated elements with square
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   275
brackets around them:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   276
     </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   277
     <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   278
      &gt;&gt;&gt; a = [10, 'Python programming', 20.3523, 23, 3534534L]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   279
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   280
[10, 'Python programming', 20.3523, 23, 3534534L]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   281
     </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   282
     <div class="section" title="1.1.Common List Operations">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   283
      <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   284
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   285
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   286
         <h3 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   287
          <a name="id2951624">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   288
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   289
          1.1.Common List Operations
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   290
         </h3>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   291
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   292
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   293
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   294
      <p id="ch3list_tuples_2">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   295
       The following are some of the most commonly used operations on
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   296
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   297
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   298
         Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   299
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   300
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   301
       .
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   302
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   303
      <div class="section" title="1.1.1.Indexing">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   304
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   305
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   306
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   307
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   308
           <a name="id2951669">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   309
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   310
           1.1.1.Indexing
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   311
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   312
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   313
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   314
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   315
       <p id="ch3list_tuples_3">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   316
        Individual elements of a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   317
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   318
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   319
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   320
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   321
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   322
        can be accessed using an index to the element.
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   323
The indices start at 0. One can also access the elements of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   324
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   325
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   326
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   327
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   328
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   329
        in reverse
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   330
using negative indices.:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   331
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   332
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   333
        &gt;&gt;&gt; a[1]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   334
'Python programming'
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   335
&gt;&gt;&gt; a[-1]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   336
3534534L
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   337
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   338
       <p id="ch3list_tuples_4">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   339
        It is important to note here that the last element of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   340
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   341
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   342
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   343
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   344
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   345
        has an index of
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   346
-1.
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   347
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   348
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   349
      <div class="section" title="1.1.2.Concatenating">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   350
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   351
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   352
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   353
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   354
           <a name="id3002805">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   355
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   356
           1.1.2.Concatenating
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   357
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   358
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   359
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   360
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   361
       <p id="ch3list_tuples_5">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   362
        Two or more
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   363
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   364
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   365
          Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   366
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   367
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   368
        can be concatenated using the + operator:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   369
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   370
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   371
        &gt;&gt;&gt; a + ['foo', 12, 23.3432, 54]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   372
[10, 'Python programming', 20.3523, 'foo', 12, 23.3432, 54]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   373
&gt;&gt;&gt; [54, 75, 23] + ['write', 67, 'read']
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   374
[54, 75, 23, 'write', 67, 'read']
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   375
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   376
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   377
      <div class="section" title="1.1.3.Slicing">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   378
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   379
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   380
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   381
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   382
           <a name="id3002825">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   383
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   384
           1.1.3.Slicing
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   385
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   386
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   387
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   388
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   389
       <p id="ch3list_tuples_6">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   390
        A
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   391
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   392
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   393
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   394
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   395
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   396
        can be sliced off to contain a subset of elements of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   397
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   398
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   399
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   400
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   401
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   402
        . Slicing
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   403
can be done by using two indices separated by a colon, where the first index is
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   404
inclusive and the second index is exclusive. The resulting slice is also a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   405
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   406
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   407
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   408
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   409
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   410
        .:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   411
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   412
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   413
        &gt;&gt;&gt; num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   414
&gt;&gt;&gt; num[3:6]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   415
[4, 5, 6]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   416
&gt;&gt;&gt; num[0:1]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   417
[1]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   418
&gt;&gt;&gt; num[7:10]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   419
[7, 8, 9]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   420
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   421
       <p id="ch3list_tuples_7">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   422
        The last example showed how to access last 3 elements of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   423
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   424
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   425
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   426
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   427
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   428
        . There is a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   429
small catch here. The second index 10 actually refers to the 11th element of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   430
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   431
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   432
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   433
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   434
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   435
        which is still valid, even though it doesn't exist because the second
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   436
index is exclusive and tells the Python interpreter to get the last element of
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   437
the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   438
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   439
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   440
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   441
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   442
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   443
        . But this can also be done in a much easier way using negative indices:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   444
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   445
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   446
        &gt;&gt;&gt; num[-3:-1]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   447
[7, 8, 9]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   448
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   449
       <p id="ch3list_tuples_8">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   450
        Excluding the first index implies that the slice must start at the beginning of
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   451
the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   452
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   453
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   454
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   455
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   456
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   457
        , while excluding the second index includes all the elements till the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   458
end of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   459
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   460
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   461
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   462
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   463
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   464
        . A third parameter to a slice, which is implicitly taken as 1
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   465
is the step of the slice. It is specified as a value which follows a colon after
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   466
the second index:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   467
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   468
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   469
        &gt;&gt;&gt; num[:4]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   470
[1, 2, 3, 4]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   471
&gt;&gt;&gt; num[7:]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   472
[8, 9]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   473
&gt;&gt;&gt; num[-3:]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   474
[7, 8, 9]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   475
&gt;&gt;&gt; num[:]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   476
[1, 2, 3, 4, 5, 6, 7, 8, 9]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   477
&gt;&gt;&gt; num[4:9:3]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   478
[5, 8]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   479
&gt;&gt;&gt; num[3::2]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   480
[4, 6, 8]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   481
&gt;&gt;&gt; num[::4]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   482
[1, 5, 9]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   483
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   484
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   485
      <div class="section" title="1.1.4.Multiplication">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   486
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   487
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   488
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   489
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   490
           <a name="id3002905">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   491
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   492
           1.1.4.Multiplication
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   493
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   494
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   495
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   496
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   497
       <p id="ch3list_tuples_9">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   498
        A
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   499
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   500
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   501
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   502
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   503
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   504
        can be multiplied with an integer to repeat itself:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   505
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   506
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   507
        &gt;&gt;&gt; [20] * 5
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   508
[20, 20, 20, 20, 20]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   509
&gt;&gt;&gt; [42, 'Python', 54] * 3
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   510
[42, 'Python', 54, 42, 'Python', 54, 42, 'Python', 54]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   511
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   512
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   513
      <div class="section" title="1.1.5.Membership">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   514
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   515
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   516
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   517
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   518
           <a name="id3002929">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   519
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   520
           1.1.5.Membership
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   521
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   522
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   523
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   524
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   525
       <p id="ch3list_tuples_a">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   526
        <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   527
         <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   528
          in
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   529
         </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   530
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   531
        operator is used to find whether an element is part of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   532
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   533
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   534
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   535
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   536
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   537
        . It
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   538
returns
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   539
        <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   540
         <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   541
          True
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   542
         </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   543
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   544
        if the element is present in the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   545
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   546
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   547
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   548
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   549
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   550
        or
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   551
        <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   552
         <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   553
          False
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   554
         </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   555
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   556
        if it is not
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   557
present. Since this operator returns a Boolean value it is called a Boolean
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   558
operator:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   559
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   560
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   561
        &gt;&gt;&gt; names = ['Guido', 'Alex', 'Tim']
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   562
&gt;&gt;&gt; 'Tim' in names
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   563
True
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   564
&gt;&gt;&gt; 'Adam' in names
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   565
False
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   566
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   567
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   568
      <div class="section" title="1.1.6.Length, Maximum and Minimum">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   569
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   570
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   571
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   572
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   573
           <a name="id3002972">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   574
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   575
           1.1.6.Length, Maximum and Minimum
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   576
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   577
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   578
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   579
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   580
       <p id="ch3list_tuples_b">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   581
        Length of a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   582
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   583
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   584
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   585
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   586
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   587
        can be found out using the len function. The max function
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   588
returns the element with the largest value and the min function returns the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   589
element with the smallest value:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   590
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   591
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   592
        &gt;&gt;&gt; num = [4, 1, 32, 12, 67, 34, 65]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   593
&gt;&gt;&gt; len(num)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   594
7
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   595
&gt;&gt;&gt; max(num)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   596
67
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   597
&gt;&gt;&gt; min(num)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   598
1
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   599
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   600
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   601
      <div class="section" title="1.1.7.Changing Elements">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   602
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   603
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   604
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   605
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   606
           <a name="id3002997">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   607
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   608
           1.1.7.Changing Elements
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   609
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   610
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   611
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   612
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   613
       <p id="ch3list_tuples_c">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   614
        Unlike Strings
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   615
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   616
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   617
          Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   618
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   619
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   620
        are mutable, i.e. elements of a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   621
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   622
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   623
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   624
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   625
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   626
        can be manipulated:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   627
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   628
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   629
        &gt;&gt;&gt; a = [1, 3, 5, 7]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   630
&gt;&gt;&gt; a[2] = 9
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   631
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   632
[1, 3, 9, 7]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   633
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   634
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   635
      <div class="section" title="1.1.8.Deleting Elements">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   636
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   637
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   638
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   639
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   640
           <a name="id3003022">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   641
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   642
           1.1.8.Deleting Elements
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   643
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   644
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   645
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   646
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   647
       <p id="ch3list_tuples_d">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   648
        An element or a slice of a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   649
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   650
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   651
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   652
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   653
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   654
        can be deleted by using the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   655
        <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   656
         <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   657
          del
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   658
         </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   659
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   660
        statement:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   661
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   662
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   663
        &gt;&gt;&gt; a = [1, 3, 5, 7, 9, 11]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   664
&gt;&gt;&gt; del a[-2:]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   665
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   666
[1, 3, 5, 7]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   667
&gt;&gt;&gt; del a[1]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   668
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   669
[1, 5, 7]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   670
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   671
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   672
      <div class="section" title="1.1.9.Assign to Slices">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   673
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   674
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   675
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   676
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   677
           <a name="id3003050">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   678
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   679
           1.1.9.Assign to Slices
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   680
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   681
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   682
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   683
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   684
       <p id="ch3list_tuples_e">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   685
        In the same way, values can be assigned to individual elements of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   686
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   687
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   688
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   689
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   690
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   691
        ,
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   692
a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   693
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   694
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   695
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   696
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   697
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   698
        of elements can be assigned to a slice:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   699
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   700
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   701
        &gt;&gt;&gt; a = [2, 3, 4, 5]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   702
&gt;&gt;&gt; a[:2] = [0, 1]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   703
[0, 1, 4, 5]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   704
&gt;&gt;&gt; a[2:2] = [2, 3]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   705
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   706
[0, 1, 2, 3, 4, 5]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   707
&gt;&gt;&gt; a[2:4] = []
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   708
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   709
[0, 1, 4, 5]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   710
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   711
       <p id="ch3list_tuples_f">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   712
        The last two examples should be particularly noted carefully. The last but one
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   713
example insert elements or a list of elements into a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   714
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   715
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   716
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   717
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   718
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   719
        and the last example
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   720
deletes a list of elements from the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   721
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   722
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   723
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   724
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   725
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   726
        .
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   727
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   728
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   729
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   730
     <div class="section" title="1.2.None, Empty Lists, and Initialization">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   731
      <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   732
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   733
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   734
         <h3 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   735
          <a name="id3003090">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   736
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   737
          1.2.None, Empty Lists, and Initialization
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   738
         </h3>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   739
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   740
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   741
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   742
      <p id="ch3list_tuples_10">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   743
       An
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   744
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   745
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   746
         Empty List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   747
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   748
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   749
       is a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   750
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   751
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   752
         List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   753
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   754
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   755
       with no elements and is simply represented as
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   756
[]. A
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   757
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   758
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   759
         None List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   760
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   761
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   762
       is one with all elements in it being
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   763
       <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   764
        <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   765
         None
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   766
        </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   767
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   768
       . It serves
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   769
the purpose having a container list of some fixed number of elements with
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   770
no value:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   771
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   772
      <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   773
       &gt;&gt;&gt; a = []
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   774
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   775
[]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   776
&gt;&gt;&gt; n = [None] * 10
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   777
&gt;&gt;&gt; n
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   778
[None, None, None, None, None, None, None, None, None, None]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   779
      </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   780
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   781
     <div class="section" title="1.3.Nested Lists">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   782
      <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   783
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   784
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   785
         <h3 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   786
          <a name="id3003130">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   787
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   788
          1.3.Nested Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   789
         </h3>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   790
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   791
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   792
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   793
      <p id="ch3list_tuples_11">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   794
       As mentioned earlier, a List can contain elements of any data type. This also
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   795
implies a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   796
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   797
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   798
         List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   799
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   800
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   801
       can have a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   802
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   803
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   804
         Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   805
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   806
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   807
       themselves as its elements. These are
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   808
called as
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   809
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   810
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   811
         Nested Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   812
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   813
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   814
       . There is no limit on the depth of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   815
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   816
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   817
         Nested Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   818
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   819
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   820
       :
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   821
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   822
      <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   823
       &gt;&gt;&gt; a = [1, [1, 2, 3], 3, [1, [1, 2, 3]], 7]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   824
      </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   825
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   826
     <div class="section" title="1.4.List Methods">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   827
      <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   828
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   829
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   830
         <h3 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   831
          <a name="id3003165">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   832
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   833
          1.4.List Methods
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   834
         </h3>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   835
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   836
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   837
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   838
      <p id="ch3list_tuples_12">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   839
       A method is a function that is coupled to an object. More about objects
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   840
and its methods are discussed in Advanced Python module. In general, a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   841
method is called like:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   842
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   843
      <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   844
       object.method(arguments)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   845
      </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   846
      <p id="ch3list_tuples_13">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   847
       For now, it is enough to know that a list of elements is an object and
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   848
so
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   849
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   850
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   851
         List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   852
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   853
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   854
       methods can be called upon them. Also some of the methods change
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   855
the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   856
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   857
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   858
         List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   859
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   860
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   861
       in-place, meaning it modifies the existing list instead of creating
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   862
a new one, while other methods don't. It must be noted as we run through
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   863
the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   864
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   865
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   866
         List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   867
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   868
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   869
       methods.
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   870
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   871
      <p id="ch3list_tuples_14">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   872
       Some of the most commonly used
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   873
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   874
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   875
         List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   876
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   877
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   878
       methods are as follows:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   879
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   880
      <div class="section" title="1.4.1.append">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   881
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   882
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   883
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   884
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   885
           <a name="id3003212">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   886
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   887
           1.4.1.append
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   888
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   889
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   890
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   891
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   892
       <p id="ch3list_tuples_15">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   893
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   894
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   895
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   896
          append
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   897
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   898
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   899
        method is used to append an object at the end of the list:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   900
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   901
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   902
        &gt;&gt;&gt; prime = [2, 3, 5]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   903
&gt;&gt;&gt; prime.append(7)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   904
&gt;&gt;&gt; prime
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   905
[2, 3, 5, 7]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   906
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   907
       <p id="ch3list_tuples_16">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   908
        It is important to note that append changes the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   909
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   910
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   911
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   912
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   913
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   914
        in-place.
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   915
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   916
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   917
      <div class="section" title="1.4.2.count">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   918
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   919
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   920
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   921
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   922
           <a name="id3003241">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   923
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   924
           1.4.2.count
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   925
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   926
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   927
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   928
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   929
       <p id="ch3list_tuples_17">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   930
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   931
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   932
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   933
          count
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   934
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   935
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   936
        method returns the number of occurences of a particular element
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   937
in a list:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   938
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   939
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   940
        &gt;&gt;&gt; [1, 4, 4, 9, 9, 9].count(9)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   941
3
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   942
&gt;&gt;&gt; tlst = ['Python', 'is', 'a', 'beautiful', 'language']
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   943
&gt;&gt;&gt; tlst.count('Python')
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   944
1
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   945
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   946
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   947
      <div class="section" title="1.4.3.extend">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   948
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   949
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   950
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   951
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   952
           <a name="id3003264">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   953
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   954
           1.4.3.extend
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   955
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   956
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   957
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   958
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   959
       <p id="ch3list_tuples_18">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   960
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   961
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   962
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   963
          extend
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   964
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   965
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   966
        method extends the list on which it is called by the list supplied
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   967
as argument to it:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   968
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   969
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   970
        &gt;&gt;&gt; a = [1, 2, 3]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   971
&gt;&gt;&gt; b = [4, 5, 6]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   972
&gt;&gt;&gt; a.extend(b)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   973
[1, 2, 3, 4, 5, 6]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   974
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   975
       <p id="ch3list_tuples_19">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   976
        This is an in-place method. This method is equivalent to using the + operator, but
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   977
using the + operator returns a new list.
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   978
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   979
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   980
      <div class="section" title="1.4.4.index">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   981
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   982
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   983
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   984
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   985
           <a name="id3003292">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   986
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   987
           1.4.4.index
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   988
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   989
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   990
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   991
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   992
       <p id="ch3list_tuples_1a">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   993
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   994
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   995
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   996
          index
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   997
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   998
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
   999
        method returns the index position of the element in the list
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1000
specified as argument:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1001
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1002
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1003
        &gt;&gt;&gt; a = [1, 2, 3, ,4, 5]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1004
&gt;&gt;&gt; a.index(4)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1005
3
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1006
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1007
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1008
      <div class="section" title="1.4.5.insert">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1009
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1010
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1011
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1012
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1013
           <a name="id3003311">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1014
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1015
           1.4.5.insert
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1016
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1017
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1018
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1019
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1020
       <p id="ch3list_tuples_1b">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1021
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1022
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1023
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1024
          insert
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1025
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1026
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1027
        method is used to insert an element specified as the second
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1028
argument to the list at the position specified by the first argument:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1029
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1030
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1031
        &gt;&gt;&gt; a = ['Python', 'is', 'cool']
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1032
&gt;&gt;&gt; a.insert(2, 'so')
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1033
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1034
['Python', 'is', 'so', 'cool']
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1035
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1036
       <p id="ch3list_tuples_1c">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1037
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1038
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1039
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1040
          insert
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1041
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1042
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1043
        method changes the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1044
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1045
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1046
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1047
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1048
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1049
        in-place.
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1050
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1051
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1052
      <div class="section" title="1.4.6.pop">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1053
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1054
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1055
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1056
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1057
           <a name="id3003346">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1058
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1059
           1.4.6.pop
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1060
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1061
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1062
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1063
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1064
       <p id="ch3list_tuples_1d">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1065
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1066
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1067
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1068
          pop
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1069
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1070
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1071
        method removes an element from the list. The index position
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1072
of the element to be removed can be specified as an argument to the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1073
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1074
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1075
          pop
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1076
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1077
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1078
        method, if not it removes the last element by default:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1079
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1080
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1081
        &gt;&gt;&gt; a = [1, 2, 3, 4, 5]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1082
&gt;&gt;&gt; a.pop()
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1083
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1084
5
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1085
&gt;&gt;&gt; a.pop(2)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1086
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1087
3
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1088
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1089
       <p id="ch3list_tuples_1e">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1090
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1091
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1092
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1093
          pop
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1094
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1095
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1096
        method changes the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1097
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1098
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1099
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1100
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1101
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1102
        in-place.
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1103
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1104
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1105
      <div class="section" title="1.4.7.remove">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1106
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1107
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1108
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1109
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1110
           <a name="id3003383">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1111
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1112
           1.4.7.remove
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1113
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1114
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1115
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1116
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1117
       <p id="ch3list_tuples_1f">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1118
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1119
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1120
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1121
          remove
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1122
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1123
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1124
        method removes the first occurence of an element supplied as a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1125
parameter:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1126
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1127
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1128
        &gt;&gt;&gt; a = [1, 2, 3, 4, 2, 5, 2]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1129
&gt;&gt;&gt; a.remove(2)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1130
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1131
[1, 3, 4, 2, 5, 2]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1132
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1133
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1134
      <div class="section" title="1.4.8.reverse">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1135
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1136
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1137
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1138
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1139
           <a name="id3003405">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1140
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1141
           1.4.8.reverse
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1142
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1143
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1144
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1145
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1146
       <p id="ch3list_tuples_20">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1147
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1148
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1149
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1150
          reverse
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1151
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1152
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1153
        method reverses elements in the list. It is important to note
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1154
here that
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1155
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1156
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1157
          reverse
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1158
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1159
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1160
        method changes the list in-place and doesn't return any
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1161
thing:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1162
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1163
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1164
        &gt;&gt;&gt; a = ['guido', 'alex', 'tim']
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1165
&gt;&gt;&gt; a.reverse()
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1166
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1167
['tim', 'alex', 'guido']
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1168
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1169
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1170
      <div class="section" title="1.4.9.sort">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1171
       <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1172
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1173
         <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1174
          <h4 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1175
           <a name="id3003431">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1176
           </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1177
           1.4.9.sort
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1178
          </h4>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1179
         </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1180
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1181
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1182
       <p id="ch3list_tuples_21">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1183
        The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1184
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1185
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1186
          sort
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1187
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1188
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1189
        method is used to sort the elements of the list. The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1190
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1191
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1192
          sort
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1193
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1194
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1195
        method
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1196
also sorts in-place and does not return anything:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1197
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1198
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1199
        &gt;&gt;&gt; a = [5, 1, 3, 7, 4]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1200
&gt;&gt;&gt; a.sort()
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1201
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1202
[1, 3, 4, 5, 7]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1203
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1204
       <p id="ch3list_tuples_22">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1205
        In addition to the sort method on a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1206
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1207
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1208
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1209
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1210
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1211
        object we can also use the built-in
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1212
        <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1213
         <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1214
          sorted
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1215
         </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1216
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1217
        function. This function takes the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1218
        <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1219
         <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1220
          List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1221
         </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1222
        </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1223
        as a parameter and returns
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1224
a sorted copy of the list. However the original list is left intact:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1225
       </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1226
       <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1227
        &gt;&gt;&gt; a = [5, 1, 3, 7, 4]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1228
&gt;&gt;&gt; b = sorted(a)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1229
&gt;&gt;&gt; b
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1230
[1, 3, 4, 5, 7]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1231
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1232
[5, 1, 3, 7, 4]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1233
       </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1234
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1235
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1236
    </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1237
    <div class="section" title="2.Tuples">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1238
     <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1239
      <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1240
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1241
        <h2 class="title" style="clear: both">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1242
         <a name="id3003481">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1243
         </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1244
         2.Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1245
        </h2>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1246
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1247
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1248
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1249
     <p id="ch3list_tuples_23">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1250
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1251
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1252
        Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1253
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1254
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1255
      are sequences just like
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1256
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1257
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1258
        Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1259
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1260
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1261
      , but they are immutable. In other
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1262
words
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1263
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1264
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1265
        Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1266
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1267
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1268
      provides a way to represent a group of items, where the group
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1269
of items cannot be changed in any way. The syntax of a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1270
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1271
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1272
        Tuple
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1273
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1274
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1275
      is also very
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1276
similar to
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1277
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1278
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1279
        List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1280
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1281
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1282
      . A
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1283
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1284
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1285
        Tuple
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1286
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1287
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1288
      is represented with the list of items, called
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1289
elements of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1290
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1291
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1292
        Tuple
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1293
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1294
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1295
      separated by comma, with the entire list being enclosed
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1296
in parenthesis. It is not compulsory to use parenthesis around a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1297
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1298
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1299
        Tuple
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1300
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1301
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1302
      but
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1303
it may be necessary in some of the cases:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1304
     </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1305
     <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1306
      &gt;&gt;&gt; a = 1, 2, 3
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1307
&gt;&gt;&gt; a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1308
(1, 2, 3)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1309
&gt;&gt;&gt; b = 1,
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1310
&gt;&gt;&gt; b
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1311
(1,)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1312
     </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1313
     <p id="ch3list_tuples_24">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1314
      It is interesting to note the second example. Just a value followed by a comma
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1315
automatically makes that an element of a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1316
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1317
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1318
        Tuple
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1319
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1320
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1321
      with only one element. It is
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1322
also important to note that, irrespective of input having a parenthesis, the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1323
output always has a parenthesis.
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1324
     </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1325
     <p id="ch3list_tuples_25">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1326
      The first example is also known as
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1327
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1328
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1329
        Tuple packing
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1330
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1331
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1332
      , because values are being
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1333
packed into a tuple. It is also possible to do
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1334
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1335
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1336
        Tuple unpacking
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1337
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1338
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1339
      which is more
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1340
interesting. It is better to understand that by example. Say we have a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1341
co-ordinate pair from which we need to separate x and y co-ordinates:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1342
     </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1343
     <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1344
      &gt;&gt;&gt; a = (1, 2)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1345
&gt;&gt;&gt; x, y = a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1346
&gt;&gt;&gt; x
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1347
1
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1348
&gt;&gt;&gt; y
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1349
2
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1350
     </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1351
     <p id="ch3list_tuples_26">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1352
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1353
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1354
        Tuple unpacking
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1355
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1356
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1357
      also has several other use-cases of which the most interesting
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1358
one is to swap the values of two variables. Using programming languages like C
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1359
would require anywhere around 10 lines of code and an extra temporary variable
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1360
to do this (including all the #include stuff). Python does it in the most
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1361
intuitive way in just one line. Say we want to swap the co-ordinates in the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1362
above example:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1363
     </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1364
     <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1365
      &gt;&gt;&gt; x, y = y, x
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1366
&gt;&gt;&gt; x
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1367
2
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1368
&gt;&gt;&gt; y
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1369
1
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1370
     </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1371
     <div class="section" title="2.1.Common Tuple Operations">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1372
      <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1373
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1374
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1375
         <h3 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1376
          <a name="id3003578">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1377
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1378
          2.1.Common Tuple Operations
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1379
         </h3>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1380
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1381
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1382
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1383
      <p id="ch3list_tuples_27">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1384
       There is no need to introduce all the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1385
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1386
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1387
         Tuple
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1388
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1389
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1390
       operations again, since
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1391
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1392
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1393
         Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1394
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1395
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1396
       support the following operations that
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1397
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1398
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1399
         List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1400
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1401
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1402
       supports in exactly the same way:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1403
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1404
      <div class="itemizedlist">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1405
       <ul class="itemizedlist" type="*">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1406
        <li class="listitem" style="list-style-type: *">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1407
         <p id="ch3list_tuples_28">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1408
          Indexing
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1409
         </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1410
        </li>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1411
        <li class="listitem" style="list-style-type: *">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1412
         <p id="ch3list_tuples_29">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1413
          Concatenating
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1414
         </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1415
        </li>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1416
        <li class="listitem" style="list-style-type: *">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1417
         <p id="ch3list_tuples_2a">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1418
          Slicing
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1419
         </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1420
        </li>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1421
        <li class="listitem" style="list-style-type: *">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1422
         <p id="ch3list_tuples_2b">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1423
          Membership
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1424
         </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1425
        </li>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1426
        <li class="listitem" style="list-style-type: *">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1427
         <p id="ch3list_tuples_2c">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1428
          Multiplication
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1429
         </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1430
        </li>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1431
        <li class="listitem" style="list-style-type: *">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1432
         <p id="ch3list_tuples_2d">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1433
          Length, Maximum, Minimum
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1434
         </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1435
        </li>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1436
       </ul>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1437
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1438
      <p id="ch3list_tuples_2e">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1439
       The following examples illustrate the above operations:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1440
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1441
      <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1442
       &gt;&gt;&gt; a = (1, 2, 3, 4, 5, 6)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1443
&gt;&gt;&gt; a[5]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1444
6
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1445
&gt;&gt;&gt; b = (7, 8, 9)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1446
&gt;&gt;&gt; a + b
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1447
(1, 2, 3, 4, 5, 6, 7, 8, 9)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1448
&gt;&gt;&gt; a[3:5]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1449
(4, 5)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1450
&gt;&gt;&gt; 5 in a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1451
True
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1452
&gt;&gt;&gt; c = (1,)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1453
&gt;&gt;&gt; c * 5
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1454
(1, 1, 1, 1, 1)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1455
&gt;&gt;&gt; len(a)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1456
6
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1457
&gt;&gt;&gt; max(a)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1458
6
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1459
&gt;&gt;&gt; min(a)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1460
1
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1461
      </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1462
      <p id="ch3list_tuples_2f">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1463
       However the following
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1464
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1465
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1466
         List
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1467
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1468
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1469
       operations are not supported by
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1470
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1471
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1472
         Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1473
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1474
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1475
       because
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1476
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1477
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1478
         Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1479
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1480
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1481
       cannot be changed once they are created:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1482
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1483
      <div class="itemizedlist">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1484
       <ul class="itemizedlist" type="*">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1485
        <li class="listitem" style="list-style-type: *">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1486
         <p id="ch3list_tuples_30">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1487
          Changing elements
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1488
         </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1489
        </li>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1490
        <li class="listitem" style="list-style-type: *">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1491
         <p id="ch3list_tuples_31">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1492
          Deleting elements
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1493
         </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1494
        </li>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1495
        <li class="listitem" style="list-style-type: *">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1496
         <p id="ch3list_tuples_32">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1497
          Assigning to slices
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1498
         </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1499
        </li>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1500
       </ul>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1501
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1502
      <p id="ch3list_tuples_33">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1503
       Similarity to
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1504
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1505
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1506
         Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1507
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1508
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1509
       leads to the questions like, why not
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1510
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1511
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1512
         Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1513
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1514
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1515
       only? Why do
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1516
we even want
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1517
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1518
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1519
         Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1520
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1521
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1522
       ? Can we do the same with
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1523
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1524
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1525
         Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1526
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1527
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1528
       ? And the answer is
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1529
       <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1530
        <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1531
         Yes
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1532
        </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1533
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1534
       we can do it, but
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1535
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1536
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1537
         Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1538
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1539
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1540
       are helpful at times, like we can return Tuples from
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1541
functions. They are also returned by some built-in functions and methods. And
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1542
also there are some use cases like co-ordinate among other things. So
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1543
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1544
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1545
         Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1546
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1547
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1548
       are helpful.
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1549
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1550
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1551
    </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1552
    <div class="section" title="3.Additional Syntax">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1553
     <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1554
      <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1555
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1556
        <h2 class="title" style="clear: both">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1557
         <a name="id3003727">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1558
         </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1559
         3.Additional Syntax
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1560
        </h2>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1561
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1562
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1563
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1564
     <p id="ch3list_tuples_34">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1565
      The following additional syntax are introduced to make it easier to operate on
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1566
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1567
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1568
        Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1569
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1570
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1571
      .
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1572
     </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1573
     <div class="section" title="3.1.range()">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1574
      <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1575
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1576
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1577
         <h3 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1578
          <a name="id3003745">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1579
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1580
          3.1.range()
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1581
         </h3>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1582
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1583
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1584
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1585
      <p id="ch3list_tuples_35">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1586
       The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1587
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1588
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1589
         range
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1590
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1591
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1592
       function takes at least one argument and 2 additional optional
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1593
arguments. If two or more arguments are specified, the range function returns
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1594
a list of natural numbers starting from the first argument passed to it to the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1595
second argument. The third argument, if specified is used as a step. Suppose
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1596
only one argument is specified, then
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1597
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1598
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1599
         range
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1600
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1601
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1602
       function returns a list of natural
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1603
numbers starting from 0 upto the argument specified:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1604
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1605
      <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1606
       &gt;&gt;&gt; range(5, 10, 2)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1607
[5, 7, 9]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1608
&gt;&gt;&gt; range(2, 15)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1609
[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1610
&gt;&gt;&gt; range(12)
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1611
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1612
      </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1613
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1614
     <div class="section" title="3.2.for">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1615
      <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1616
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1617
        <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1618
         <h3 class="title">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1619
          <a name="id3003777">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1620
          </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1621
          3.2.for
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1622
         </h3>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1623
        </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1624
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1625
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1626
      <p id="ch3list_tuples_36">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1627
       The
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1628
       <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1629
        <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1630
         for
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1631
        </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1632
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1633
       keyword is used as a part of the looping construct. Unlike for loops
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1634
in other languages, Python's for is used to iterate through the elements of
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1635
sequences like
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1636
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1637
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1638
         Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1639
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1640
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1641
       ,
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1642
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1643
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1644
         Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1645
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1646
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1647
       ,
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1648
       <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1649
        <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1650
         Dictionaries
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1651
        </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1652
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1653
       , etc. The syntax of the for loop
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1654
consists of
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1655
       <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1656
        <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1657
         for
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1658
        </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1659
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1660
       , followed by a variable to hold the individual or the current
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1661
element of the list during iteration and
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1662
       <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1663
        <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1664
         in
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1665
        </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1666
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1667
       , followed by the sequence and a
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1668
semicolon(':') The next line which is part of the
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1669
       <span class="strong">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1670
        <strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1671
         for
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1672
        </strong>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1673
       </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1674
       loop, i.e the statements
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1675
that are part of the loop should start with a new intend:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1676
      </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1677
      <pre class="programlisting">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1678
       &gt;&gt;&gt; names = ['Guido', 'Alex', 'Tim']
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1679
&gt;&gt;&gt; for name in names:
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1680
...   print "Name =", name
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1681
...
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1682
Name = Guido
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1683
Name = Alex
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1684
Name = Tim
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1685
      </pre>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1686
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1687
    </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1688
    <div class="section" title="4.Conclusion">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1689
     <div class="titlepage">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1690
      <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1691
       <div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1692
        <h2 class="title" style="clear: both">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1693
         <a name="id3003836">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1694
         </a>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1695
         4.Conclusion
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1696
        </h2>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1697
       </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1698
      </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1699
     </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1700
     <p id="ch3list_tuples_37">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1701
      This section on
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1702
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1703
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1704
        Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1705
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1706
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1707
      and
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1708
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1709
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1710
        Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1711
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1712
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1713
      introduces almost all the necessary
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1714
machinary required to work on
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1715
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1716
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1717
        Lists
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1718
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1719
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1720
      and
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1721
      <span class="emphasis">
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1722
       <em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1723
        Tuples
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1724
       </em>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1725
      </span>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1726
      . Topics like how to
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1727
use these data structures in bigger more useful programs will be introduced
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1728
in the subsequent chapters.
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1729
     </p>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1730
    </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1731
   </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1732
  </div>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1733
 </body>
cb14131583c6 Started on final changes to the build scripts so that we can start with totally automatic builds
amit@thunder
parents:
diff changeset
  1734
</html>