30 lines
1007 B
Markdown
30 lines
1007 B
Markdown
---
|
|
id: practical-python-3.1
|
|
source_exercise_id: "3.1"
|
|
title: "Structuring a program as a collection of functions"
|
|
section: "3.1 Scripting"
|
|
source_path: "03_Program_organization/01_Script.md"
|
|
source_repo: "https://github.com/dabeaz-course/practical-python"
|
|
source_commit: "93dca856b41c61a0a0f85ae334116e4c125629ea"
|
|
student_visible_solution: false
|
|
has_private_solution: false
|
|
skip: false
|
|
---
|
|
|
|
# Exercise 3.1: Structuring a program as a collection of functions
|
|
|
|
> Source: Practical Python Programming, `03_Program_organization/01_Script.md`.
|
|
|
|
### Exercise 3.1: Structuring a program as a collection of functions
|
|
|
|
Modify your `report.py` program so that all major operations,
|
|
including calculations and output, are carried out by a collection of
|
|
functions. Specifically:
|
|
|
|
* Create a function `print_report(report)` that prints out the report.
|
|
* Change the last part of the program so that it is nothing more than a series of function calls and no other computation.
|
|
|
|
## 关联来源
|
|
|
|
- [[summaries/01_Script]]
|