On the copyright page (facing the first page of the Preface), there is a printing history of the book. The printing history is a row of numbers that—at the 1st printing—looks like this:
10 9 8 7 6 5 4 3 2 1
At each subsequent printing, one number is removed from the end of this row of numbers to indicate which printing of the book you have. For example, the last number in the row of numbers in the 2nd printing is 2, and so on. In the list below, [n] means that an error is fixed in the nth printing.
valid = len(string) == 13 position = 0 while valid and position < len(string) : if position == 0 : valid = string[position] == "(" elif position == 4 : valid = string[position] == ")" elif position == 8 : valid = string[position] == "-" else : valid = string[position].isdigit() position = position + 1 if valid : print("The string contains a valid phone number.") else : print("The string does not contain a valid phone number.")and the second code block with
valid = len(string) == 13 position = 0 while valid and position < len(string) : valid = ((position == 0 and string[position] == "(") or (position == 4 and string[position] == ")") or (position == 8 and string[position] == "-") or (position != 0 and position != 4 and position != 8 and string[position].isdigit())) position = position + 1
tolower
to lower
and toupper
to upper
)
after pyramidVolume(9, 10)
and pyramidVolume(0, 10)
in Step 6 and in lines 7 and 9 of ch05/pyramids.pydef gradeToNumber(String grade)
to def gradeToNumber(grade) :
def tensName(number)
, i.e. def tensName(number)
:
def printTriangle(sideLength)
, i.e. def printTriangle(sideLength) :
circus
in the second line of text” to “the word eggs
in the third line of text”line = line.rsplit()
to line = line.rstrip()
total >= 0
to total < LIMIT
http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
to http://people.csail.mit.edu/rivest/Rsapaper.pdf
__init__
to reset
is
and is not
operators do not check whether the data contained in the objects are equal, but whether two variables refer to the same object. Objects that contain the same data”, and change “reg3
will be equal to reg1
” to “reg3
will have the same data as reg1
”Thanks to Claude Anderson, Anas Salah Eddin, Hideki Sano, Erfan Zahrai, Daniel Zingaro and (your name might go here) for their bug reports and suggestions
Please report any remaining bugs in this edition on the bug report form.