June 2002
Beginner to intermediate
640 pages
14h 24m
English
If you followed along with the interactive sessions in previous chapters as recommended, you ran into errors, most of them involving syntax (I know I have). Here's an example:
>>> for x in xrange(0, 100)
... Traceback (innermost last):
(no code object) at line 0
File "<stdin>", line 1
for x in xrange(0, 100)
^
SyntaxError: invalid syntax
Using SyntaxError: invalid syntax as a clue, we discover that we forgot to put the colon at the end of the for header. There's not much you can do about syntax errors except fix them. As you learn Python, you'll see such errors less and less.
Perhaps some readers have run into exceptions like this one:
>>> list = 1 >>> for x in list: ... print(`x`) ... Traceback (innermost last): ...
Read now
Unlock full access