Note that the schedule of lectures is tentative and may change, particularly with respect to guest lecturer availability.

Week 1 (27th of July - 31st of July)#

Lectures:

  • Lecture 1: Introduction to the course and administrative matters (slides)
  • Lecture 2: Functional abstraction (slides)

Code:

Week 2 (3rd of August - 7th of August)#

Lectures:

  • Lecture 1: Values, types and expressions (slides)
  • Lecture 2: Functions (slides)

Code:

Reading guide:

  • In Downey: Chapters 1, 2 and 3.
  • In Punch & Enbody: Chapter 1 (excluding 1.10) and the beginning of Chapter 6, up to (not including) 6.3.3.

Week 3 (10th of August - 14th of August)#

Lectures:

  • Lecture 1: Program control flow, part 1: Branching (slides)
  • Lecture 2: Program control flow, part 2: Iteration (slides)

Code:

Reading guide:

  • In Downey: Chapter 5, Chapter 6 up to (not including) section “More Recursion”, and Chapter 7.
  • In Punch & Enbody: Chapter 2, except the parts about for loops (for example, section 2.2.13).

Week 4 (17th of August - 21st of August)#

  • Lecture 1: Sequence data types, part 1 (slides)
  • Lecture 2: Code quality and debugging (slides)

Code:

Reading guide:

Both books begin with strings as the first sequence type. We will get to strings in Week 5. However, parts of the relevant chapters describe properties of strings that are in fact common to all sequence types, and can be read without worrying about character representation.

  • In Downey: Chapter 8, up to (not including) section “String Methods”.
  • In Punch & Enbody: Section 4.1 (sections 4.1.1 and 4.1.2 are specific to strings, and will become relevant in Week 5).
  • Downey’s book has a section on debugging in every chapter. The advice in the debugging sections of chapters 1 through 8 is all relevant and useful to debugging the kinds of programs we have written so far.

Week 5 (24th of August - 28th of August)#

  • Lecture 1: Strings and more sequences (slides)
  • Lecture 2: Testing and defensive programming (slides)

Code:

Reading guide:

  • In Downey: Chapter 8.
  • In Punch & Enbody: Chapter 4. Section 4.4 and 4.7 on string formatting can be skipped.
  • Downey’s book has a section on debugging in every chapter. The advice in the debugging sections of chapters 1 through 8 is all relevant and useful to debugging the kinds of programs we have written so far.

Code:

Week 6 (31st of August - 4th of September)#

  • Lecture 1: Data science (slides)
  • Lecture 2: Examples on code quality and live demo of debugging in Spyder (slides).

Code:

Reading guide:

Break#

Week 7 (21st of September - 25th of September)#

  • Lecture 1: Sequence data types, part 2 (slides).
  • Lecture 2: Functions, part 2 (slides).

Code:

Reading guide:

  • In Downey: Chapter 10 (lists), Chapters 3, 5 and 6, and section “Global variables” in Chapter 11 (functions and scope).
  • In Punch & Enbody: Chapter 7, except 7.7 (lists). Note: Sections 7.5.2 and 7.9 contain examples that use file reading, which we have not covered yet. You can skip these sections, or just just copy-paste the file-reading code and not worry too much about it. Chapter 6, up to (not including) section 6.3.4; Section 8.1; Section 9.6 (functions and scope).

Week 8 (28th of September - 2nd of October)#

  • Lecture 1: Files and I/O (slides).
  • Lecture 2: Floats (slides).

Code:

Reading guide:

Week 9 (5th of October - 9th of October)#

  • Lecture 1: Complexity (slides).
  • Lecture 2: Dictionaries and sets (slides).

Reading guide:

  • In Downey: Chapter 11 up to section “Memos” and section “Sets” in Chapter 19 (Chapter 19 is covers a variety of topics, some of which we have already touched on, and some which we will not cover in this course.) Chapter 21 (“Analysis of Algorithms”, called Appendix B in the on-line editition) introduces complexity analysis of algorithms.
  • In Punch & Enbody: Chapter 9 up to (not including) section 9.6 (dictionaries and sets).

Code:

Week 10 (12th of October - 16th of October)#

  • Lecture 1: Program control flow, part 3: Dynamic programming (slides).
  • Lecture 2: Exceptions (slides).

Code:

Reading guide:

  • In Downey: Chapter 20 (called “Appendix A” in the on-line edition), and section “Catching Exceptions” in Chapter 14. Section “Memos” in Chapter 11 of Downey’s book briefly covers the idea behind dynamic programming (but considers only using a dictionary to store the intermediate results).
  • In Punch & Enbody: Section 5.6 and Sections 14.4 to 14.6 cover exceptions (with a focus on handling, unfortunately). This book does not mention dynamic programming.

Week 11 (19th of October - 23rd of October)#

  • Lecture 1: Modules and programs (slides).
  • Lecture 2: no lecture.

Code:

Reading guide:

  • There is only a short section called “Writing Modules”, in Chapter 14, in Downey’s book.

Week 12 (26th of October - 30th of October)#

  • Lecture 1: no lecture.
  • Lecture 2: Exam revision.
bars search times arrow-up