day1/Session-2.vrb
author Madhusudan.C.S <madhusudancs@gmail.com>
Thu, 08 Oct 2009 15:41:59 +0530
changeset 59 9aac0f128482
parent 46 63704b5650f1
permissions -rw-r--r--
Removed slides on pdb from session 4.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     1
\frametitle {\typ{for}: the list companion}
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     2
  \begin{lstlisting}
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     3
In [89]: for p, ch in enumerate( a ):
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     4
   ....:     print p, ch
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     5
   ....:
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     6
   ....:
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     7
0 a
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     8
1 b
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     9
2 c
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    10
  \end{lstlisting}
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    11
Try: \typ{print enumerate(a)}
63704b5650f1 Changed the copyright and Institute for all the sessions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    12
\inctime{10}