FAQ
Update of /cvsroot/python/python/dist/src/Doc/tut
In directory sc8-pr-cvs1:/tmp/cvs-serv2044

Modified Files:
Tag: release23-maint
tut.tex
Log Message:
SF patch #797868: Tutorial, sec. 5.1.4 could contain an extra example
(Revised from the original patch contributed by Michal Pasternak.)

Also, make a couple minor fixups elsewhere.



Index: tut.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v
retrieving revision 1.196.8.4
retrieving revision 1.196.8.5
diff -C2 -d -r1.196.8.4 -r1.196.8.5
*** tut.tex 23 Aug 2003 03:47:56 -0000 1.196.8.4
--- tut.tex 30 Aug 2003 23:24:37 -0000 1.196.8.5
***************
*** 123,127 ****
single statement;
\item
! statement grouping is done by indentation instead of begin/end
brackets;
\item
--- 123,127 ----
single statement;
\item
! statement grouping is done by indentation instead of beginning and ending
brackets;
\item
***************
*** 518,522 ****
Traceback (most recent call last):
File "<stdin>", line 1, in ?
! TypeError: can't convert complex to float; use e.g. abs(z)
a.real
3.0
--- 518,522 ----
Traceback (most recent call last):
File "<stdin>", line 1, in ?
! TypeError: can't convert complex to float; use abs(z)
a.real
3.0
***************
*** 1929,1932 ****
--- 1929,1940 ----
[vec1[i]*vec2[i] for i in range(len(vec1))]
[8, 12, -54]
+ \end{verbatim}
+
+ List comprehensions are much more flexible than \function{map()} and can be
+ applied to functions with more than one argument and to nested functions:
+
+ \begin{verbatim}
+ >>> [str(round(355/113.0, i)) for i in range(1,6)]
+ ['3.1', '3.14', '3.142', '3.1416', '3.14159']
\end{verbatim}

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-checkins @
categoriespython
postedAug 30, '03 at 5:24p
activeAug 30, '03 at 5:24p
posts1
users1
websitepython.org

1 user in discussion

Rhettinger: 1 post

People

Translate

site design / logo © 2019 Grokbase