Lesson 3: Computation by accumulation
Outline:
- Questions?
- Recap Lesson 2: Python expressions
- value versus side effect
- Exercise 1
- Repetition via
forloops- definite loops using
for: Exercise 4 from Lesson 2 - working with
range(): Exercise 2 - accumulator pattern (practice with
forloops!)
- definite loops using
- Data visualization
- plotting earthquakes: code and background image
- A taste of object-oriented programming
graphics.py: code and documentation
Explore after class:
- More practice with loops:
- work on Exercises 2b and 2c if you haven’t already
- more accumulator patterns: Exercises 3+4
- The
mathlibrary - More practice with
graphics.py: Exercise 5
What’s next
Upcoming assessments:
- Homework assignment 2 is now released, and due next Thursday (with a short assessment due Monday at 10pm)
- Quiz 1 will be next Friday (they are every even-week Friday)
What you should do now:
- The readings (see below)
- Submit Assignment 1 by 3pm today if you’re using a token
- Read the description of Assignment 2 and complete Part 0 this weekend
Reading assignment (to be completed by the next class):
- Zelle chapter 3 (pp. 59–79)
- Zelle sections 4.1–4.3 (pp. 87–94)
- Assignment #2 (due next Thursday at 10pm, with a short assessment due Monday at 10pm)