Sei sulla pagina 1di 13

A heavily functionalized program as compared with a monolithic (i.e.

, one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The

function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a

rguments, if an omitted argument is not the rightmost argument in the argument l


ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte

rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and

the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.

4.13 Default Arguments


Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono

lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.

A heavily functionalized program as compared with a monolithic (i.e., one-piece) p


rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The

function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a

rguments, if an omitted argument is not the rightmost argument in the argument l


ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte

rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and

the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.

4.13 Default Arguments


Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.
A heavily functionalized program as compared with a monolithic (i.e., one-piece) p
rogram without functions makes potentially large numbers of function calls, and th
ese consume execution time and memory space on a computer s processor(s). But mono
lithic programs are difficult to program, test, debug and maintain. 4.4
So functionalize programs judiciously, always keeping in mind the delicate balan
ce between performance and good software engineering.
4.13 Default Arguments
Function calls may commonly pass a particular value of an argument. When definin
g a function, the programmer can specify an argument as a default argument, and
the programmer can provide a default value for that argument. Default arguments
are a convenience; they allow the programmer to specify fewer arguments when cal
ling a function. When a default argument is omitted in a function call, the inte
rpreter inserts the default value of that argument and passes the argument in th
e call. Default arguments must appear to the right of any non-default arguments
in a function s parameter list. When calling a function with two or more default a
rguments, if an omitted argument is not the rightmost argument in the argument l
ist, all arguments to the right of that argument also must be omitted. Figure 4.
20 demonstrates using default arguments in calculating the volume of a box. The
function definition for boxVolume in line 5 specifies that all three arguments h
ave been given default values of 1. Note that default values should be defined o
nly in the function s def statement.

Potrebbero piacerti anche