Back to the Introduction to Computer Science outline The Course Maker
Introduction to Computer Science outline
Week 7 · Module overview

Week 7 — Module Framing · Functions

Introduction to Computer Science · CSCI 1101 Fall 2026 · Prof. Okafor Fictional sample

Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Module: Week 7 of 16 · Fall 2026 · in-person, two 75-minute coding-along studio sessions
Objective covered: Objective 5 — Write functions with parameters and return, call them and use their results, and reason about local vs. global scope.

This file holds two pieces: (A) the Module 7 Overview page ("Start Here") and (B) the Welcome Announcement that drips out when the module opens. Dates below assume a Tuesday/Thursday pattern with Week 7 meeting Tue Oct 13 and Thu Oct 15, a Coding Lab that same week, and end-of-week work due Sunday Oct 18, 11:59 p.m. Adjust the day-of-week and times to match your section.


(A) Module 7 Overview — Start Here

Welcome to Week 7: Functions

This is your home base for the week. Read it first, then work the checklist below from top to bottom. Everything you need is linked inside the module.

For six weeks you've been writing code as one long top-to-bottom script. This week you learn the single most important tool for organizing code: the function — a named, reusable block you define once and call as many times as you want. You'll write functions with def, hand them inputs through parameters, get an answer back with return, and use that answer in the rest of your program. You'll also meet the week's two classic confusions head-on: return vs. print (a function that prints but never returns hands back None — so print(f()) shows None), and scope (a variable born inside a function isn't visible outside, and reassigning it inside doesn't change the outer one). The course habit carries straight through: don't guess what a function returns or what a call prints — run it and read what Python actually does.

Heads-up — this is the last topic on the Midterm. The Week 8 Midterm is cumulative over Weeks 1–7 (computing → variables → I/O & strings → Booleans & conditionals → whilefor/range/nested → functions). Nail functions this week and you've seen everything the midterm can ask.

The week's big question

"How do I package a piece of work once — give it inputs and get an answer back — so I can reuse it instead of rewriting it?"

By Friday you'll define a function with parameters, return a value and use the result, explain why a no-return function yields None, and predict what a function call prints — including the None cases — and what variables are visible where.

By the end of this week, you can…

Use this as a checklist. If you can do all five, you're ready for the quiz.

  • [ ] Define and call a function with def, passing arguments to its parameters and running it more than once.
  • [ ] return a value and use the result — store it, print it, or drop it into a bigger expression.
  • [ ] Tell return from print — and predict the None you get from print(f()) when f only prints and never returns.
  • [ ] Reason about scope — know that a variable created inside a function isn't visible outside, and that reassigning a name inside doesn't change the outer variable.
  • [ ] Spot & fix a function bug — a forgotten return (function yields None), a print-where-you-meant-return, or a scope mix-up — by running it.

What's due this week, and when

Work these in order — each one gets you ready for the next.

# Do this Type Due
1 Read the week's readings + watch the linked videos Read / watch (ungraded prep) Before Thu Oct 15
2 Skim the slides (Deck 7) and the Week 7 lecture outline Prep (ungraded) Alongside class
3 Lecture Tutorial 7 — work through def, parameters/arguments, return, return-vs-print (the None surprise), and scope with one approved chatbot (Gemini, Claude, or ChatGPT), then submit the conversation share link Lecture Tutorial · graded (5% group) Sun Oct 18, 11:59 p.m.
4 Practice exercises — low-stakes reps to lock in the ideas Practice · ungraded Sun Oct 18 (recommended)
5 Coding Lab 7 — "Define, Return, Scope" — write two functions with parameters + return, run a predict-then-run table of calls (including one that prints None), fix a missing-return/return-vs-print bug, and watch a function's local frame appear and vanish in Python Tutor — then catch the AI calling a no-return function's printed value its "return" Coding Lab · graded (Coding Labs, 15% group) · 50 pts Sun Oct 18, 11:59 p.m.
6 Quiz 7 — covers def, parameters/arguments, return, return-vs-print/None, scope, parameter order, and a missing-return debug Quiz · graded (Quizzes, 10% group) Sun Oct 18, 11:59 p.m.
7 Discussion 7 — "Break It Into Functions" — take a bigger task (a receipt program or a quiz-scorer) and argue how to decompose it into functions, weighing DRY and single-responsibility, in a dialogue with one approved chatbot, then post the AI summary + your chat link and reply to two classmates Discussion · graded (Discussions, 10% group) Initial post Fri Oct 16; replies Sun Oct 18
8 Assignment 7 — "Write, Return, Trace, Fix" — write functions with parameters and return, predict an output (incl. a None case), trace scope, and fix a missing-return bug, coached and scored by one approved chatbot Assignment · graded (Assignments, 15% group) · 100 pts Sun Oct 18, 11:59 p.m.

Heads-up on the AI tools: you'll use a chatbot as a pair-programmer to draft and explain — and then you check its work by running the code. Functions are a place chatbots slip in a very specific way: they'll tell you a function with no return "returns" whatever it printed. It doesn't — it returns None. Catching that — by running print(f()) and reading the real output — is the point, in the tutorial, the assignment, and the lab.

How to succeed this week

  • Run everything. A function's behavior is exactly what Python does when you call it. Write it, call it, print the result, and read the output. Every time — especially the None cases.
  • Two hooks to memorize. "print shows it to a human; return hands it back to the program." And "no return means the function returns None."
  • Predict, then check — twice. For every call, say two things out loud: what does the call print? and what value comes back? Then run it. The gap between those two questions is the whole week.
  • Watch the box appear and disappear. Paste a function call into Python Tutor and step forward: a new frame pops up with the local variables, then vanishes when the function returns. That picture is what "scope" means.
  • Treat the chatbot as a smart intern, not an oracle. It drafts a function; you run it and check what it actually returns. That habit is the whole semester in miniature — and it matters most right here.

You don't need any setup for this week — the Python environment runs in your browser, nothing to install. Come to class ready to define your first function. See you Tuesday.


(B) Welcome Announcement — Module 7

Release setting: post on the module's start day (offset = 0 days), i.e., Tue Oct 13, 2026 — not before. If your platform won't preserve the scheduled date on import, post this as a draft labeled "Release: Tue Oct 13."

Subject: Week 7 — Functions (and it's the last thing on the midterm) 🧩

Hi everyone,

For six weeks your programs have been one long script, running top to bottom. This week we learn to package work into reusable pieces — functions. You'll define a function once with def, feed it inputs through parameters, get an answer back with return, and call it again and again. It's the biggest jump in "writing real programs" so far, and it's genuinely fun.

This week — Functions — we tackle the big question: How do I package a piece of work once, give it inputs and get an answer back, so I can reuse it instead of rewriting it? By Friday you'll write functions with parameters and return, use their results, and reason about what's visible where (scope).

One thing to circle on your calendar: functions are the last topic on the Midterm (Week 8), which is cumulative over Weeks 1–7. If you lock in this week, you've seen everything the midterm covers.

Three things not to miss:
1. Lecture Tutorial 7 — work through def, parameters vs. arguments, return, the return-vs-print None surprise, and scope with one approved chatbot (Gemini, Claude, or ChatGPT) and submit the share link. Due Sun Oct 18.
2. Coding Lab 7 ("Define, Return, Scope"), Quiz 7, Discussion 7, and Assignment 7 also close Sun Oct 18 — the lab is where you write your own functions and watch a local scope come and go in Python Tutor, so start early.
3. Open the Start Here page first — it lays out everything in order with due dates.

The habit, sharpened for functions: never trust an output you didn't run. A chatbot will confidently tell you a function "returns" the thing it printed — but a function with no return hands back None, so print(f()) shows None. The source of truth is the same as always: run the code and read what Python actually prints and returns.

Bring your curiosity (and a willingness to be surprised by a None) to class on Tuesday.

See you soon,
Prof. Okafor


~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com