Remove mention of the identity operator (is) because it's subtle in ways that aren't appropriate for beginners. This does unfortunately mean we're doing inappropriate comparisons to None but I think that's a small price to pay.
Chapter 4: Conditions
Formatting and flesh out text
Add a section asking students to find an indentation bug
Merge sections describing else and elif and flesh out the explanation with an example in English and pseudocode
Chapter 5: Lists, Tuples, and Sets
Minor text corrections and flesh out a little
Avoid mentioning "dictionary"
Summarise in intro with a table rather than text
Add a question for students about creating an empty set(). This is meant for them to discover a pitfall. The correct answer is set(), not {} which is a dict.
Add section on unpacking and the unpacking operator *
Chapter 6: Loops
Flesh out explanation of loops where students were confused in previous teaching sessions.
Explain loop iteration with loop unrolling
Emphasise reading for as for-each
Subtly introduce iterables
Emphasise enumerate() over raw indexing with a guided "example problem".
Introduce the conventional use of _
Highlight the danger of while
Add an exercise demonstrating the danger of while.
Chapter 8: Dictionaries
Flesh out and correct text a little
Describe the correct way to loop over the keys in a dictionary
Formatting
Chapter 9: Files
Formatting
Use context managers (with) everywhere
Describe why with is better than manually calling open()/close()
Chapter 10: Functions
Formatting
Fleshed out and corrected text a little
Cover an error students might encounter writing and using their own functions
Restructure and flesh out section titled "Flexibility in functions"
Reference back to chapter 5 unpacking and *
Talk about keyword arguments
Add a section with some advice on writing functions
Chapter 1: Introduction
help()
functionsChapter 2: Variables and operators
is
) because it's subtle in ways that aren't appropriate for beginners. This does unfortunately mean we're doing inappropriate comparisons toNone
but I think that's a small price to pay.Chapter 4: Conditions
else
andelif
and flesh out the explanation with an example in English and pseudocodeChapter 5: Lists, Tuples, and Sets
set()
. This is meant for them to discover a pitfall. The correct answer isset()
, not{}
which is adict
.*
Chapter 6: Loops
for
asfor
-eachenumerate()
over raw indexing with a guided "example problem"._
while
while
.Chapter 8: Dictionaries
Chapter 9: Files
with
) everywherewith
is better than manually callingopen()
/close()
Chapter 10: Functions
*
Solutions