Save this video free

Python (Fall 2026) Module 7-4: Parameters and Return Values

Bill Moseley, Ph.D. - Computer Science Educator · 8:54 · Watch on YouTube

Python (Fall 2026) Module 7-4: Parameters and Return Values Watch on YouTube →

Overview

Bill Moseley explains Python functions as black boxes: callers need to know a function’s name, required inputs, and outputs, but not its internal implementation. He demonstrates how a string parameter makes a welcome function reusable, then shows how a two-integer addition function returns a result that can be stored in a variable or passed directly to print().

Key takeaways

Chapters

0:00 Functions as Black Boxes and the Purpose of Parameters
1:44 Making doWelcome Reusable with a String Parameter
4:44 Returning the Sum from a Two-Integer Function

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:01 using parameters. So parameters, and  you're going to hear me say this, but when we create a function, we want  to think of it as kind of a black box. You know what I'm talking about when I say  black box? Like when an airplane crashes, right? It's got the black box in there.  It's the, it's the flight data recorder now. So basically, we don't know what's going  on in that flight data recorder, but it has lots of data going into it and the data can  come out later on, but we don't, it's a mystery basically what's going on in there. And if we  write a good function, if I, if I tell you, hey, guess what? I wrote a, a function that I think is  going to be really helpful. It's called doWelcome, and it prints out five lines of code  welcoming people to your program. It takes no parameters, and the, the name  of it is doWelcome with an uppercase W.

0:56 Now you can use that whenever you want. Do you  have to know what the code is inside that function in order to use it? No. All you, all you need to  know is what we keep talking about when I show you those function references, is what do I have  to put into it to make it work, and that's it. What happens in here doesn't matter. If it works,  it works. So when we write functions, that's sort of the gold standard of writing a function as  a programmer, especially if you work in a team, because what you want to be able to do is  write a function that other people can use. That's, that's what we were looking for. And in  order to do that, it has to be able to be used

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Bill Moseley, Ph.D. - Computer Science Educator.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.