Further Reading — Chapter 6: Functions

Official Documentation

Python Functions — Official Tutorial docs.python.org/3/tutorial/controlflow.html#defining-functions The official tutorial's treatment of functions — brief and authoritative.

Python Built-in Functions docs.python.org/3/library/functions.html The complete list of functions Python provides by default (like print, len, type, sorted). Worth scanning once to know what's available.

Books

"The Pragmatic Programmer" — David Thomas & Andrew Hunt The source of the DRY principle (Chapter 7: The Evils of Duplication). This book is worth reading in full for anyone who writes code regularly, regardless of experience level.

"Clean Code" — Robert C. Martin Chapter 3 ("Functions") is directly relevant to this chapter's content. Martin's rules for function design are more prescriptive than needed for business Python, but the underlying principles are sound.

Tutorials

"Python Functions" — Real Python realpython.com/defining-your-own-python-function/ Comprehensive tutorial covering everything in this chapter and more, including *args and **kwargs (covered later in this textbook).

"Python Modules and Packages" — Real Python realpython.com/python-modules-packages/ How modules work — the mechanics behind from business_math import calculate_gross_margin.

"Lambda Functions in Python" — Real Python realpython.com/python-lambda/ Deep dive on lambda functions: when to use them, when not to, and common patterns.

Design Principles

"Single Responsibility Principle" The software design principle behind "a function should do one thing." Originally from Robert C. Martin's work on object-oriented design, but applies equally to functions.

"Don't Repeat Yourself" (DRY) The Pragmatic Programmer's foundational principle. Wikipedia has a good summary with the original formulation.


Links verified at time of publication.