In this chapter, we consider a concept that has as profound an impact on control flow as do conditionals and loops: the function, which allows us to transfer control back and forth between different pieces of code. Functions are important because they allow us to clearly separate tasks within a program and because they provide a general mechanism that enables us to reuse code.
2.1 Defining Functions describes how to create your own functions in Python.
2.2 Modules and Clients describes how to group related functions into modules to enable modular programming.
2.3 Recursion considers the idea of a function calling itself. This possiblility is known as recursion.
2.4 Case Study: Percolation presents a case study that uses Monte Carlo simulation to study a natural model known as percolation.
Below is a list of Python programs and data files used in this chapter.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4