[Python-checkins] CVS: python/dist/src/Doc/tut tut.tex,1.152,1.153
Fred L. Drake
fdrake@users.sourceforge.net
Mon, 03 Dec 2001 10:54:35 -0800
Update of /cvsroot/python/python/dist/src/Doc/tut
In directory usw-pr-cvs1:/tmp/cvs-serv5854/tut
Modified Files:
tut.tex
Log Message:
Add a scalar product to the example list comprehensions based on a suggestion
sent to python-docs.
Index: tut.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v
retrieving revision 1.152
retrieving revision 1.153
diff -C2 -d -r1.152 -r1.153
*** tut.tex 2001/11/28 07:26:15 1.152
--- tut.tex 2001/12/03 18:54:33 1.153
***************
*** 1847,1850 ****
--- 1847,1852 ----
>>> [x+y for x in vec1 for y in vec2]
[6, 5, -7, 8, 7, -5, 10, 9, -3]
+ >>> [vec1[i]*vec2[i] for i in range(len(vec1))]
+ [8, 12, -54]
\end{verbatim}