Note that the schedule of lectures is tentative and may change, particularly with respect to guest lecturer availability.
Week 1 (22 - 26 July)#
Lectures:
- Tuesday lecture: Introduction to the course and administrative matters (slides)
- Wednesday lecture: Functional abstraction (slides)
Code:
- Mortgage Repayment Calculator
-
A new version of the robot module! This version should have fewer problems with the visualisation when used with Spyder or on computers running windows. (Closing the visualisation window still does not work, however.)
If the new version is causing you problems, here is the old version of the robot. You have to rename it
robot.pyfor it to work. - Stacking boxes (version without functional abstraction, 5 boxes)
- Stacking boxes with functional abstraction
Week 2 (29 July - 2 August)#
Lectures:
- Tuesday lecture: Values, types and expressions (updated slides)
- Wednesday lecture: 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 (5 - 9 August)#
Lectures:
- Tuesday lecture: Program control flow, part 1: Branching (slides)
- Wednesday lecture: Program control flow, part 2: Iteration (slides)
Code:
- Print Grade
- Count Boxes (recursive version)
- Count Boxes (iterative version)
-
The interval-halving algorithm
This is the final version, parameterised with
fandy. The file has both the recursive and the iterative implementations. - Falcon 9 simulation
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
forloops (for example, section 2.2.13).
Week 4 (12 - 16 August)#
- Tuesday lecture: Sequence data types, part 1 (slides).
- Wednesday lecture: Code quality, testing 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 (19 - 23 August)#
Code:
Reading guide:
- In Downey: Chapter 8.
- In Punch & Enbody: Chapter 4. Section 4.4 and 4.7 on string formatting can be skipped.
- The python documentation has a section about floating-point numbers.
- http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html presents a very detailed, quite mathematical, look into floating point number representation and arithmetic.
- Here is a video of a very interesting talk: https://www.youtube.com/watch?v=aP0Y1uAA-2Y. The speaker discusses alternative number systems for representing and computing with fractional numbers.
Week 6 (26 - 30 August)#
-
Note: Saturday the 31st of August is the Census date.
- Tuesday lecture: Data Science (slides).
- Wednesday lecture: Extra lecture on debugging.
Code:
Reading guide:
- There is no new recommended reading for this week.
Break#
Week 7 (16 - 20 September)#
- Tuesday lecture: Sequence data types, part 2 (slides).
- Wednesday lecture: Guest lecture by A/Prof. Rob Lanfear from the Research School of Biology (slides).
Reading guide:
- In Downey: Chapter 10 (lists).
- 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.
Week 8 (23 - 27 September)#
Reading guide:
- In Downey: Chapters 3, 5 and 6, and section “Global variables” in Chapter 11 (functions and scope). Chapter 14, up to section 14.4 “Catching Exceptions” (files), though the remainder of the chapter is useful reading if you want to do more complex file operations.
- In Punch & Enbody: Chapter 6, up to (not including) section 6.3.4; Section 8.1; Section 9.6 (functions and scope). Chapter 5, up to (not including) section 5.6 (files).
Week 9 (30 September - 4 October)#
- Tuesday lecture: Complexity (slides).
- Wednesday lecture: Abstract data types, 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:
- Examples from the lecture on complexity
- Sales count (example of use of dictionaries).
Week 10 (7 - 11 October)#
-
Note: Monday the 7th is a public holiday.
- Tuesday lecture: Exceptions (slides).
- Wednesday lecture: Program control flow, part 3: Dynamic programming (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 considering 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 (14 - 18 October)#
Code:
- The modA.py and modB.py examples.
- Command-line demo.
Reading guide:
- There is only a short section called “Writing Modules”, in Chapter 14, in Downey’s book.
Week 12 (21 - 25 October)#
- Tuesday lecture: no lecture
- Wednesday lecture: Exam revision (note: moved from Tuesday)