CSC108H (StG, Fall 2011): Lectures

Lectures

This page will contain notes from lecture, mainly from code developed during lecture, as well as any slides we use. We will try to post these notes after each lecture.

We post these materials to help you focus on thinking and participating in class without worrying about copying down every little detail. But a lot happens in lecture that will not be represented in these posted materials, and we urge you to augment them with your own personal notes. Research shows that students who take and study from their own notes consistently do better on tests than those who simply study from supplied notes. If you miss class, it would be a good idea to get notes from someone who was there.

Readings

Readings for each week are also listed below. You are responsible for keeping up with these during the term. Note that some of the topics may shift around a bit, depending on how we progress.

Week of L0301 (MWF9 with Michelle) L0101 (MWF10 with Diane) L0102 (MWF10 with Michelle) L0201 (MWF1 with Diane) L5101 (W6-9 with Dan)
  • 12 Sep
  • Readings: chapter 1 (Introduction to Python)
Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Wednesday Night:
  • Slides and Shell
  • The sun.py developed in lecture. There's a version of this code in the slides as well; the one in the slides combines a couple of lines to make the code shorter
  • Pictures bahen.jpg and niagara.jpg
  • first_mod.py: another example of a module
  • 19 Sep
  • Readings: chapter 2 (Python basics)
Monday: Wednesday:
  • Slides (pdf)
  • print and raw_input (marks.py))
  • play_a_song.py (pdf)
  • laugh.wav jingle.wav doglake.wav
    Friday:
    Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Wednesday Night:
    • Slides and Shell
    • Sounds doglake.wav and piano.wav (I encourage you to use headphones and test the first of these, after removing the left channel. You'll notice something I couldn't show in lecture, which is that there's a dog in one of the channels!)
    • The sound functions developed in lecture
    • bio_calc.py
    • bad_style.py: I didn't cover this, but I might next week. In any event, please go through it as a first example of a poor docstring (and code that won't work because it tries to access a local variable that doesn't exist outside of the function)
    • 26 Sep
    • Readings: section 5.6 (mutability, aliasing), chapter 6 (booleans)
    Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Wednesday Night:
    • 03 Oct
    • Readings: chapter 3 (strings), sections 7.2 - 7.7 (while loops)
    Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Wednesday Night:
    • 10 Oct
    • Readings: chapter 5 (lists)
    Monday: No Class Thanksgiving
    Wednesday: Friday:
    Monday: No Class Thanksgiving
    Wednesday: Friday:
    Monday: No Class Thanksgiving
    Wednesday: Friday:
    Monday: No Class Thanksgiving
    Wednesday: Friday:
    Wednesday Night:
    • Slides and Shell
    • Two versions of the number-guessing game from lecture: game.py and while_guess.py. Compare these and make sure you understand their differences and how they work. Also try guessing the number on your first try and rocking out to some Absent-Minded this weekend!
    • termination_trace.py (an example from lecture, with a trace below the code of what's happening)
    • 17 Oct
    • Readings: chapter 8 (files)
    Monday: Wednesday: Friday:
    • Test 1
    Monday: Wednesday:
    • shell (nested lists, association lists)
    • shell (image association lists)
    • -- we didn't cover this, but it will help you with A2
    • alists.py (functions with association lists)
    Friday:
    • Test 1
    Monday: Wednesday: Friday:
    • Test 1
    Monday: Wednesday:
    • shell (nested lists, association lists)
    • shell (image association lists)
    • alists.py (functions with association lists)
    Friday:
    • Test 1
    Wednesday Night:
    • 24 Oct
    • Readings: sections 9.2, 9.5 (dictionaries)
    Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Wednesday Night:
    • 31 Oct
    • Readings: sections 4.5 (testing), 12.3, 12.4 (debugging)
    Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Wednesday Night:
    • 07 Nov
    • Readings: chapter 13 (classes)
    Monday: No classes reading break!
    Wednesday: Friday:
    Monday: Fall break!
    Wednesday: Friday:
    Monday: No classes Fall Break!
    Wednesday: Friday:
    Monday: Fall break!
    Wednesday: Friday:
    Wednesday Night:
    • 14 Nov
    • Readings: sections 11.3, 11.4 (sorting)
    Monday: Wednesday: Friday:
    • Test 2
    Monday: Wednesday: Friday:
    • Test 2
    Monday: Wednesday: Friday:
    • Test 2
    Monday: Wednesday: Friday:
    • Test 2
    Wednesday Night:
    • 21 Nov
    • Readings: chapter 10 (complexity)
    Monday:
  • Survey.txt to parse
  • Wednesday: Friday:
    Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Wednesday Night:
    • 28 Nov
    • Readings: none
    Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Monday: Wednesday: Friday: Wednesday Night:
    • 05 Dec
    • Readings: none (wrapup)
    Monday: Wednesday: Monday: Wednesday: Monday: Wednesday: Monday: Wednesday: Wednesday Night:
    • No class this week