author | Santosh G. Vattam <vattam.santosh@gmail.com> |
Thu, 08 Oct 2009 22:48:06 +0530 | |
changeset 74 | a476c09dcf24 |
parent 46 | 63704b5650f1 |
permissions | -rw-r--r-- |
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} |