@@ -1215,7 +1215,7 @@ \section{\keyword{pass} Statements \label{pass}}
12151215For example:
12161216
12171217\begin {verbatim }
1218- >>> while 1 :
1218+ >>> while True :
12191219... pass # Busy-wait for keyboard interrupt
12201220...
12211221\end {verbatim }
@@ -1358,7 +1358,7 @@ \subsection{Default Argument Values \label{defaultArgs}}
13581358
13591359\begin {verbatim }
13601360def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
1361- while 1 :
1361+ while True :
13621362 ok = raw_input(prompt)
13631363 if ok in ('y', 'ye', 'yes'): return 1
13641364 if ok in ('n', 'no', 'nop', 'nope'): return 0
@@ -3076,10 +3076,10 @@ \section{Syntax Errors \label{syntaxErrors}}
30763076kind of complaint you get while you are still learning Python:
30773077
30783078\begin {verbatim }
3079- >>> while 1 print 'Hello world'
3079+ >>> while True print 'Hello world'
30803080 File "<stdin>", line 1, in ?
3081- while 1 print 'Hello world'
3082- ^
3081+ while True print 'Hello world'
3082+ ^
30833083SyntaxError: invalid syntax
30843084\end {verbatim }
30853085
@@ -3149,7 +3149,7 @@ \section{Handling Exceptions \label{handling}}
31493149raising the \exception {KeyboardInterrupt} exception.
31503150
31513151\begin {verbatim }
3152- >>> while 1 :
3152+ >>> while True :
31533153... try:
31543154... x = int(raw_input("Please enter a number: "))
31553155... break
@@ -3760,7 +3760,7 @@ \subsection{Method Objects \label{methodObjects}}
37603760
37613761\begin {verbatim }
37623762xf = x.f
3763- while 1 :
3763+ while True :
37643764 print xf()
37653765\end {verbatim }
37663766
0 commit comments