What Are Functions?
Functions are the structured or procedural programming way of organizing
the logic in your programs. Large blocks of code can be neatly segregated
into manageable chunks, and space is saved by putting oft-repeated code in
functions as opposed to multiple copies everywhere—this also helps with
consistency because changing the single copy means you do not have to hunt
for and make changes to multiple copies of duplicated code. The basics of
functions in Python are not much different from those of other languages
with which you may be familiar. After a bit of review here in the early part of
this chapter, we will focus on what else Python brings to the table.
ps:一些概念需要牢记于心。