🔍 Unit 3: Modular Programming & Recursion — Pre-Unit Diagnostic
Assessment FOR Learning — Teacher Feedback
📋 Not Graded — Descriptive Feedback Only
Purpose: Confirms readiness for functions, scope, and recursion. Tests prior fluency with calling pre-built functions, basic decomposition, and self-referential reasoning.
Question 2 — Define a simple function (Unit 1 review)
Write a Python function area_of_rectangle(length, width) that returns the area.
Question 3 — Decomposition: a real task
Imagine you are writing a program that sends each student in a class an email with their final mark. Break the overall task into 3-5 smaller subtasks that could each become a separate function.
Question 4 — Logic: self-reference (math)
Define the factorial of a positive integer n in your own words, using the idea of "smaller version of the same problem". Write your definition for both n = 1 and n > 1.
Question 5 — Mental trace
Work out each step. F(n) is defined as: F(1) = 1, F(n) = n + F(n-1). What is F(5)?
Question 6 — Naming & abstraction
A friend writes a function called do_it() that does many things at once. List two better names if the function (a) calculates a tax, (b) reads a file and writes a summary.
Question 7 — Reading a function signature
If you see def f(x, y=10, z=0):, answer:
How many arguments are required when calling f?
What is f(2)'s effective (x, y, z)?
What is f(2, 5)'s effective (x, y, z)?
Question 8 — Reflection
Have you ever written a function that calls itself? If yes, what was it for? If no, what about recursion intrigues or worries you?