Chapter 5. FUNCTIONS
Functions in Python borrow more from C rather than Perl. Perl's approach to functions is to allow you to supply a list of arguments to any function and the entire list, including the contents of arrays or hashes supplied, are placed into the @_ variable. It's up to the function definition to decide what to do with the list of arguments that has been supplied and how to interpret the supplied list into the information the function needs.
There are a few minor problems with this approach, some of which have been resolved over the years. For example, there is no way to identify the types of arguments you expect, unless you use prototypes. When calling a function we are also limited to accepting a list of arguments or supplying ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access