November 2001
Beginner
320 pages
5h 53m
English
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 ...