[Python-checkins] CVS: python/dist/src/Doc/tut tut.tex,1.134,1.135
Fred L. Drake
fdrake@users.sourceforge.net
2001年5月21日 09:55:42 -0700
Update of /cvsroot/python/python/dist/src/Doc/tut
In directory usw-pr-cvs1:/tmp/cvs-serv22716/tut
Modified Files:
tut.tex
Log Message:
Update output to reflect additional precision produced by the repr() of
floating point numbers in an interactive example.
Added comment to help explain control flow in the example code showing
how to check if a number is prime.
This closes SF bugs 419434 and 424552.
Index: tut.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v
retrieving revision 1.134
retrieving revision 1.135
diff -C2 -r1.134 -r1.135
*** tut.tex 2001年04月25日 21:03:20 1.134
--- tut.tex 2001年05月21日 16:55:39 1.135
***************
*** 1167,1170 ****
--- 1167,1171 ----
... break
... else:
+ ... # loop fell through without finding a factor
... print n, 'is a prime number'
...
***************
*** 2610,2617 ****
\begin{verbatim}
>>> x = 10 * 3.14
! >>> y = 200*200
>>> s = 'The value of x is ' + `x` + ', and y is ' + `y` + '...'
>>> print s
! The value of x is 31.4, and y is 40000...
>>> # Reverse quotes work on other types besides numbers:
... p = [x, y]
--- 2611,2618 ----
\begin{verbatim}
>>> x = 10 * 3.14
! >>> y = 200 * 200
>>> s = 'The value of x is ' + `x` + ', and y is ' + `y` + '...'
>>> print s
! The value of x is 31.400000000000002, and y is 40000...
>>> # Reverse quotes work on other types besides numbers:
... p = [x, y]