Week 11
Python
Tuesday
Destructive Programming
- Colab notes: week-11.ipynb
- Configure Colab:
- Turn on the “show indentation guides” option in Colab and set the indentation width to 4 spaces.
- These options will make it easier to see the levels of indentation, which affect how Python interprets your code.
- (Click the gear icon in the upper right to open the settings pane)
Thursday
Survey Please take about 10 minutes to fill out this mid-semester survey. Your answers will be anonymous: https://docs.google.com/forms/d/e/1FAIpQLSdCdVEqT7JpdO9h0x8gCbZuZ6hnJL0ZZErq33zULFcIfsq_Fw/viewform
Midterm 2 Review
- Practice Problems posted on Campuswire: https://campuswire.com/c/G916D3D51/feed/31
- Try to do them before Thursday's class
- We'll go over the solutions on Thursday
Review and Promises for Midterm 2
- Logistics:
- 75 points / 75 minutes
- budget your time one point per minute
- designed the length with a 75-minute lecture in mind
- actually have 120 minutes for our lab, so time should not be an issue
- Reference notes (from the Exams section of the syllabus):
- you may refer to an 8.5×11-inch piece of paper, double-sided, with anything written (or typed) on it that you want.
- preparing this sheet of notes is an excellent way to study, encouraging you to consider what’s important that you will want to refer to.
- You are on your honor:
- due to five sections of the course taking their exam at different times on Friday
- we will ask you to attest that you have not discussed, and will not discuss, the contents of the exam with anyone until everyone has taken the exam.
- we will let you know as soon as all students have taken the exam
- Topics:
- While the exam is necessarily cumulative, the emphasis will be on topics we've covered since the first Midterm. You are generally responsible for the material in
- chapters 9, 10, 11, 13, and 14 of the DCIC text
- Ch. 9: Lists
- Ch. 10: Processing Lists
- Ch. 11: Structured Data
- Ch. 13: Recursive Data
- Ch. 14: Trees
- corresponding lectures from weeks 6, 7, and 9
- labs 5, 6, and 7
- assignments 4, 5, and 6
- Promises:
- 5 questions, points for each question will be indicated
- all Pyret, no Python
- practice problems shared as a PDF in Campuswire. Please try to do these before Thursday's class. We'll go over some of them on Thursday
- Problem 1. Step-by-step development of a non-recursive function that takes a list of numbers, and uses an anonymous function and a built-in list function in its body (like Problem 5 on the practice problems)
- Problem 2. Expressions involving built-in list functions. (like Problem 6 on the practice problems)
- Problem 3. Given a recursive data definition (like Problem 2–The Cat in the Hat–on the practice problems), make examples, write a template, and a function.
- Problem 4. List of structured data. (like Problem 4 from the practice problems)
- Problem 5. Given a data definition for a Tree, and the diagram of a tree (like Problem 7 on the practice problems):
- translate the tree diagram into its Pyret representation
- design a function that takes a Tree, including all the parts a function should contain.
Friday
- Midterm 2
- Come to your regular lab in SP 309