Dec-29-2019, 04:58 PM
(Dec-28-2019, 09:22 PM)perfringo Wrote:(Dec-28-2019, 05:07 PM)Dixon Wrote: When I entered 'odds' on one line it worked. I guess the book is in error where is says on page 13 that it's OK to enter the 'odds' numbers on several lines.
No guessing here, this error is yours.
From the book:
Quote:Be sure to enter the code exactly as shown here
/.../
Note how the odds list extends over three lines, despite being a single statement. This is OK, as the interpreter won’t decide a single statement has come to an end until it finds the closing bracket (]) that matches the opening one ([). Typically, the end of the line marks the end of a statement in Python, but there can be exceptions to this general rule, and multiline lists are just one of them (we’ll meet the others later).
You didn’t entered code exactly. You didn’t follow opening and closing brackets.
You're right. A beginner's error. I'll make amends.