Week 1 (24 - 28 July)#
- Wednesday lecture: Introduction to the course and administrative matters (slides).
- Thursday lecture: Functional abstraction (slides).
- Friday: no lecture.
Week 2 (31 July - 4 Aug.)#
- Wednesday lecture: Values, types and expressions (slides).
- Thursday lecture: Functions (slides).
- Friday: no lecture.
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 (7 - 11 Aug.)#
- Wednesday lecture: Program control flow, part 1: Branching (slides).
- Thursday lecture: Program control flow, part 2: Iteration (slides).
- Friday: no lecture.
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 (14 - 18 Aug.)#
- Wednesday lecture: Sequence data types (slides).
- Thursday lecture: Strings (slides).
- Friday: no lecture.
Reading guide:
- In Downey: Chapter 8.
- In Punch & Enbody: Chapter 4, except sections 4.4 and 4.7.
Note that neither book has much material about the NumPy module and NumPy’s arrays.
Week 5 (21 - 25 Aug.)#
- Wednesday lecture: Sequence data types, part 2 (slides).
- Thursday lecture: Guest lecture by Prof. Paul Francis (Research School of Physics and Engineering): Computer Programs in Astrophysics.
- Friday: no lecture.
Reading guide:
- In Downey: Chapter 10.
- In Punch & Enbody: Chapter 7, except 7.7. 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 6 (28 Aug. - 1 Sep.)#
- Wednesday lecture: Floating point numbers (slides).
- Thursday lecture: More about NumPy (slides, code (linear equations)).
- Friday: no lecture.
Neither text book has much material on these topics.
- http://floating-point-gui.de/basic/ presents a simple overview of floating-point numbers, rounding errors, etc. It has a small Q&A for specific languages, including python.
- 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. Maybe soon we will not be using floats at all!
Break#
Week 7 (18 - 22 Sep.)#
- Wednesday lecture: More about functions, variable scope and recursion (slides).
- Thursday lecture: I/O and files (slides).
- Friday: no lecture.
Reading guide:
- In Downey: Chapters 3, 5 and 6; section “Global variables” in Chapter 11; Chapter 14, up to section “Catching Exceptions”.
- In Punch & Enbody: Chapter 6, up to (not including) section 6.3.4; Section 8.1; Section 9.6; Chapter 5, up to (not including) section 5.6.
Week 8 (25 - 29 Sep.)#
-
Monday the 25th is a public holiday.
Students in the Monday lab groups may attend other labs in this (and the following) week. As the number of students have now reduced, and not everyone shows up for lab, there should be enough space most of the time. A replacement lab has been scheduled at 11am on Thursday, in lab room N109.
- Wednesday lecture: Algorithm and problem complexity (slides).
- Thursday lecture: Dictionaries and sets (slides).
- Friday: no lecture.
Reading guide:
- In Downey: Chapter 11, except section “Memos” (we will talk about dynamic programming in a future lecture) and relevant parts of Chapter 12. Appendix B presents a short introduction to algorithm complexity analysis.
- In Punch & Enbody: Chapter 9. This book does not have any material on algorithm or problem complexity.
Week 9 (2 - 6 Oct.)#
-
Monday the 2nd is a public holiday.
Like last week, students in the Monday lab groups may attend other labs. A replacement lab has been scheduled at 11am on Thursday, in lab room N109.
- Wednesday lecture: Abstract data types (slides).
- Thursday lecture: Errors and exceptions (slides).
- Friday: no lecture.
Reading guide:
- In Downey: Chapter 20, and section “Catching Exceptions” in Chapter 14.
The
assert
statement is only mentioned briefly in Chapter 16, which otherwise is about things we do not cover in the course. Sections “Markov analysis” and “Data structures” in Chapter 13 briefly discuss data structure selection in the context of an example. - In Punch & Enbody: Section 5.6 and Sections 14.4 to 14.6 cover exceptions (with a focus on handling, unfortunately). Sections 7.9, 9.5 and Chapter 10 have a little discussion of abstraction and data structures.
Week 10 (9 - 13 Oct.)#
- Wednesday lecture: Writing python modules and programs (slides).
- Thursday lecture: Guest lecture by Dr. Megan McDonald (Research School of Biology).
- Friday: no lecture.
Reading guide:
- There is only a short section called “Writing Modules”, in Chapter 14, in Downey’s book.
- Punch & Enbody’s book does not seem to have any material on python’s module mechanism.
Week 11 (16 - 20 Oct.)#
- Wednesday lecture: Dynamic programming (slides).
- Thursday: no lecture.
- Friday: no lecture.
Reading guide:
- 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).
- Punch & Enbody’s book does not mention dynamic programming.
Week 12 (23 - 27 Oct.)#
- Wednesday lecture: Review of the mid-semester exam.
- Thursday lecture: The Thursday lecture will be used to continue the exam review, if the time in the Wednesday lecture is not enough.
- Friday: no lecture.