Before starting these problems, please read:
- Think Python, Chapter 3: Functions
- Think Python, Chapter 6: Fruitful Functions, sections 1-4
- 6.01 Python Notes, Section 2: Procedures (PDF)
The problems in the table below are taken from the 6.01 Python Tutor, an interactive environment that is not available on OCW. Do not try to answer these questions in the PDF files; answers will not be checked, and cannot be submitted.
PROBLEM # | QUESTIONS |
---|---|
2.1.1 | Fun with functions (PDF) |
2.1.2 | Functions and scope (PDF) |
2.1.3 | Scoping (PDF) |
2.2.1 | Square (PDF) |
2.2.2 | Fourth power (PDF) |
2.2.3 | Odd test (PDF) |
2.2.4 | From point A to point B (PDF) |
2.2.5 | Evaluate a quadratic at a point (PDF) |
2.2.6 | Distance from point to line (PDF) |