Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Code Reuse & Modularity in Python

We’ve previously been introduced to the concept of code blocks. From Busbee and Braunschweig’s “Code Blocks” from Programming Fundamentals:

Approaching a program as a series of components that each accomplish tasks that are part of the larger workflow gets us to a new concept: modularity or modular programming

From Busbee and Braunschweig’s “Modular Programming,” in Programming Fundamentals:

Code blocks are one way to think about these discrete parts of a program. A more precise term used in programming languages is function. “Functions are important because they allow us to take large complicated programs and to divide them into smaller manageable pieces. Because the function is a smaller piece of the overall program, we can concentrate on what we want it to do and test it to make sure it works properly” (Busbee and Braunschweig, Modular Programming).

Definitions and explanations in this chapter are adapted from Kenneth Leroy Busbee and Dave Braunschweig, Programming Fundamentals: A Modular Structured Approach, 2nd Edition (Rebus Press, 2018)

Application

Your answers to this chapter’s application questions should be added to the notebook template.

Submit the Colab link on Canvas for the assignment submission.

Acknowledgments

When building this chapter, the author consulted materials developed by: