You are on page 1of 14

Function generateWebsite takes four arguments.

The keyword argument names url, F


lash and CGI are assigned the default values "www.deitel.com", "no" and "yes", r
espectively (lines 4 5). The function identifies who is requesting the Web site an
d displays a message if the Web site is Flash- or CGI-enabled (lines 6 13). The fu
nction call in line 15 passes one argument, a value for name, to function genera
teWebsite. The function uses the default values given in the definition for the
other parameters. The function call in lines 17 18 passes three arguments to gener
ateWebsite. Variable name again has the value "Deitel". The call also assigns th
e value "yes" to keyword argument Flash and "www.deitel.com/new" to keyword argu
ment url. This function call illustrates that the order of keyword arguments is
more flexible than that of regular arguments in an ordinary function call. The P
ython interpreter matches the value "Deitel" with variable name by its position
in the function call. The Python interpreter matches the values passed to url an
d Flash by their keyword argument names rather than by their positions in the fu
nction call. The value of name must come first in any call to generateWebsite if
it is not referenced by specifying a value for name in the argument list. Line
20 demonstrates that any function argument can be referenced as a keyword even i
f it has no default value. The interactive session of Fig. 4.22 demonstrates com
mon errors when mixing nonkeyword and keyword arguments. Function call test( num
ber1 = "two", "Name" ) causes an error, because the non-keyword argument is plac
ed after the keyword argument. Function call test( number1 = "three" ) is incorr
ect, becauFunction generateWebsite takes four arguments. The keyword argument na
mes url, Flash and CGI are assigned the default values "www.deitel.com", "no" an
d "yes", respectively (lines 4 5). The function identifies who is requesting the W
eb site and displays a message if the Web site is Flash- or CGI-enabled (lines 6 1
3). The function call in line 15 passes one argument, a value for name, to funct
ion generateWebsite. The function uses the default values given in the definitio
n for the other parameters. The function call in lines 17 18 passes three argument
s to generateWebsite. Variable name again has the value "Deitel". The call also
assigns the value "yes" to keyword argument Flash and "www.deitel.com/new" to ke
yword argument url. This function call illustrates that the order of keyword arg
uments is more flexible than that of regular arguments in an ordinary function c
all. The Python interpreter matches the value "Deitel" with variable name by its
position in the function call. The Python interpreter matches the values passed
to url and Flash by their keyword argument names rather than by their positions
in the function call. The value of name must come first in any call to generate
Website if it is not referenced by specifying a value for name in the argument l
ist. Line 20 demonstrates that any function argument can be referenced as a keyw
ord even if it has no default value. The interactive session of Fig. 4.22 demons
trates common errors when mixing nonkeyword and keyword arguments. Function call
test( number1 = "two", "Name" ) causes an error, because the non-keyword argume
nt is placed after the keyword argument. Function call test( number1 = "three" )
is incorrect, becauFunction generateWebsite takes four arguments. The keyword a
rgument names url, Flash and CGI are assigned the default values "www.deitel.com
", "no" and "yes", respectively (lines 4 5). The function identifies who is reques
ting the Web site and displays a message if the Web site is Flash- or CGI-enable
d (lines 6 13). The function call in line 15 passes one argument, a value for name
, to function generateWebsite. The function uses the default values given in the
definition for the other parameters. The function call in lines 17 18 passes thre
e arguments to generateWebsite. Variable name again has the value "Deitel". The
call also assigns the value "yes" to keyword argument Flash and "www.deitel.com/
new" to keyword argument url. This function call illustrates that the order of k
eyword arguments is more flexible than that of regular arguments in an ordinary
function call. The Python interpreter matches the value "Deitel" with variable n
ame by its position in the function call. The Python interpreter matches the val
ues passed to url and Flash by their keyword argument names rather than by their
positions in the function call. The value of name must come first in any call t
o generateWebsite if it is not referenced by specifying a value for name in the
argument list. Line 20 demonstrates that any function argument can be referenced
as a keyword even if it has no default value. The interactive session of Fig. 4

.22 demonstrates common errors when mixing nonkeyword and keyword arguments. Fun
ction call test( number1 = "two", "Name" ) causes an error, because the non-keyw
ord argument is placed after the keyword argument. Function call test( number1 =
"three" ) is incorrect, becauFunction generateWebsite takes four arguments. The
keyword argument names url, Flash and CGI are assigned the default values "www.
deitel.com", "no" and "yes", respectively (lines 4 5). The function identifies who
is requesting the Web site and displays a message if the Web site is Flash- or
CGI-enabled (lines 6 13). The function call in line 15 passes one argument, a valu
e for name, to function generateWebsite. The function uses the default values gi
ven in the definition for the other parameters. The function call in lines 17 18 p
asses three arguments to generateWebsite. Variable name again has the value "Dei
tel". The call also assigns the value "yes" to keyword argument Flash and "www.d
eitel.com/new" to keyword argument url. This function call illustrates that the
order of keyword arguments is more flexible than that of regular arguments in an
ordinary function call. The Python interpreter matches the value "Deitel" with
variable name by its position in the function call. The Python interpreter match
es the values passed to url and Flash by their keyword argument names rather tha
n by their positions in the function call. The value of name must come first in
any call to generateWebsite if it is not referenced by specifying a value for na
me in the argument list. Line 20 demonstrates that any function argument can be
referenced as a keyword even if it has no default value. The interactive session
of Fig. 4.22 demonstrates common errors when mixing nonkeyword and keyword argu
ments. Function call test( number1 = "two", "Name" ) causes an error, because th
e non-keyword argument is placed after the keyword argument. Function call test(
number1 = "three" ) is incorrect, becauFunction generateWebsite takes four argu
ments. The keyword argument names url, Flash and CGI are assigned the default va
lues "www.deitel.com", "no" and "yes", respectively (lines 4 5). The function iden
tifies who is requesting the Web site and displays a message if the Web site is
Flash- or CGI-enabled (lines 6 13). The function call in line 15 passes one argume
nt, a value for name, to function generateWebsite. The function uses the default
values given in the definition for the other parameters. The function call in l
ines 17 18 passes three arguments to generateWebsite. Variable name again has the
value "Deitel". The call also assigns the value "yes" to keyword argument Flash
and "www.deitel.com/new" to keyword argument url. This function call illustrates
that the order of keyword arguments is more flexible than that of regular argum
ents in an ordinary function call. The Python interpreter matches the value "Dei
tel" with variable name by its position in the function call. The Python interpr
eter matches the values passed to url and Flash by their keyword argument names
rather than by their positions in the function call. The value of name must come
first in any call to generateWebsite if it is not referenced by specifying a va
lue for name in the argument list. Line 20 demonstrates that any function argume
nt can be referenced as a keyword even if it has no default value. The interacti
ve session of Fig. 4.22 demonstrates common errors when mixing nonkeyword and ke
yword arguments. Function call test( number1 = "two", "Name" ) causes an error,
because the non-keyword argument is placed after the keyword argument. Function
call test( number1 = "three" ) is incorrect, becauFunction generateWebsite takes
four arguments. The keyword argument names url, Flash and CGI are assigned the
default values "www.deitel.com", "no" and "yes", respectively (lines 4 5). The fun
ction identifies who is requesting the Web site and displays a message if the We
b site is Flash- or CGI-enabled (lines 6 13). The function call in line 15 passes
one argument, a value for name, to function generateWebsite. The function uses t
he default values given in the definition for the other parameters. The function
call in lines 17 18 passes three arguments to generateWebsite. Variable name agai
n has the value "Deitel". The call also assigns the value "yes" to keyword argum
ent Flash and "www.deitel.com/new" to keyword argument url. This function call i
llustrates that the order of keyword arguments is more flexible than that of reg
ular arguments in an ordinary function call. The Python interpreter matches the
value "Deitel" with variable name by its position in the function call. The Pyth
on interpreter matches the values passed to url and Flash by their keyword argum
ent names rather than by their positions in the function call. The value of name

must come first in any call to generateWebsite if it is not referenced by speci


fying a value for name in the argument list. Line 20 demonstrates that any funct
ion argument can be referenced as a keyword even if it has no default value. The
interactive session of Fig. 4.22 demonstrates common errors when mixing nonkeyw
ord and keyword arguments. Function call test( number1 = "two", "Name" ) causes
an error, because the non-keyword argument is placed after the keyword argument.
Function call test( number1 = "three" ) is incorrect, becauFunction generateWeb
site takes four arguments. The keyword argument names url, Flash and CGI are ass
igned the default values "www.deitel.com", "no" and "yes", respectively (lines 4 5
). The function identifies who is requesting the Web site and displays a message
if the Web site is Flash- or CGI-enabled (lines 6 13). The function call in line
15 passes one argument, a value for name, to function generateWebsite. The funct
ion uses the default values given in the definition for the other parameters. Th
e function call in lines 17 18 passes three arguments to generateWebsite. Variable
name again has the value "Deitel". The call also assigns the value "yes" to key
word argument Flash and "www.deitel.com/new" to keyword argument url. This funct
ion call illustrates that the order of keyword arguments is more flexible than t
hat of regular arguments in an ordinary function call. The Python interpreter ma
tches the value "Deitel" with variable name by its position in the function call
. The Python interpreter matches the values passed to url and Flash by their key
word argument names rather than by their positions in the function call. The val
ue of name must come first in any call to generateWebsite if it is not reference
d by specifying a value for name in the argument list. Line 20 demonstrates that
any function argument can be referenced as a keyword even if it has no default
value. The interactive session of Fig. 4.22 demonstrates common errors when mixi
ng nonkeyword and keyword arguments. Function call test( number1 = "two", "Name"
) causes an error, because the non-keyword argument is placed after the keyword
argument. Function call test( number1 = "three" ) is incorrect, becauFunction g
enerateWebsite takes four arguments. The keyword argument names url, Flash and C
GI are assigned the default values "www.deitel.com", "no" and "yes", respectivel
y (lines 4 5). The function identifies who is requesting the Web site and displays
a message if the Web site is Flash- or CGI-enabled (lines 6 13). The function cal
l in line 15 passes one argument, a value for name, to function generateWebsite.
The function uses the default values given in the definition for the other para
meters. The function call in lines 17 18 passes three arguments to generateWebsite
. Variable name again has the value "Deitel". The call also assigns the value "y
es" to keyword argument Flash and "www.deitel.com/new" to keyword argument url.
This function call illustrates that the order of keyword arguments is more flexi
ble than that of regular arguments in an ordinary function call. The Python inte
rpreter matches the value "Deitel" with variable name by its position in the fun
ction call. The Python interpreter matches the values passed to url and Flash by
their keyword argument names rather than by their positions in the function cal
l. The value of name must come first in any call to generateWebsite if it is not
referenced by specifying a value for name in the argument list. Line 20 demonst
rates that any function argument can be referenced as a keyword even if it has n
o default value. The interactive session of Fig. 4.22 demonstrates common errors
when mixing nonkeyword and keyword arguments. Function call test( number1 = "tw
o", "Name" ) causes an error, because the non-keyword argument is placed after t
he keyword argument. Function call test( number1 = "three" ) is incorrect, becau
Function generateWebsite takes four arguments. The keyword argument names url, F
lash and CGI are assigned the default values "www.deitel.com", "no" and "yes", r
espectively (lines 4 5). The function identifies who is requesting the Web site an
d displays a message if the Web site is Flash- or CGI-enabled (lines 6 13). The fu
nction call in line 15 passes one argument, a value for name, to function genera
teWebsite. The function uses the default values given in the definition for the
other parameters. The function call in lines 17 18 passes three arguments to gener
ateWebsite. Variable name again has the value "Deitel". The call also assigns th
e value "yes" to keyword argument Flash and "www.deitel.com/new" to keyword argu
ment url. This function call illustrates that the order of keyword arguments is
more flexible than that of regular arguments in an ordinary function call. The P

ython interpreter matches the value "Deitel" with variable name by its position
in the function call. The Python interpreter matches the values passed to url an
d Flash by their keyword argument names rather than by their positions in the fu
nction call. The value of name must come first in any call to generateWebsite if
it is not referenced by specifying a value for name in the argument list. Line
20 demonstrates that any function argument can be referenced as a keyword even i
f it has no default value. The interactive session of Fig. 4.22 demonstrates com
mon errors when mixing nonkeyword and keyword arguments. Function call test( num
ber1 = "two", "Name" ) causes an error, because the non-keyword argument is plac
ed after the keyword argument. Function call test( number1 = "three" ) is incorr
ect, becauFunction generateWebsite takes four arguments. The keyword argument na
mes url, Flash and CGI are assigned the default values "www.deitel.com", "no" an
d "yes", respectively (lines 4 5). The function identifies who is requesting the W
eb site and displays a message if the Web site is Flash- or CGI-enabled (lines 6 1
3). The function call in line 15 passes one argument, a value for name, to funct
ion generateWebsite. The function uses the default values given in the definitio
n for the other parameters. The function call in lines 17 18 passes three argument
s to generateWebsite. Variable name again has the value "Deitel". The call also
assigns the value "yes" to keyword argument Flash and "www.deitel.com/new" to ke
yword argument url. This function call illustrates that the order of keyword arg
uments is more flexible than that of regular arguments in an ordinary function c
all. The Python interpreter matches the value "Deitel" with variable name by its
position in the function call. The Python interpreter matches the values passed
to url and Flash by their keyword argument names rather than by their positions
in the function call. The value of name must come first in any call to generate
Website if it is not referenced by specifying a value for name in the argument l
ist. Line 20 demonstrates that any function argument can be referenced as a keyw
ord even if it has no default value. The interactive session of Fig. 4.22 demons
trates common errors when mixing nonkeyword and keyword arguments. Function call
test( number1 = "two", "Name" ) causes an error, because the non-keyword argume
nt is placed after the keyword argument. Function call test( number1 = "three" )
is incorrect, becauFunction generateWebsite takes four arguments. The keyword a
rgument names url, Flash and CGI are assigned the default values "www.deitel.com
", "no" and "yes", respectively (lines 4 5). The function identifies who is reques
ting the Web site and displays a message if the Web site is Flash- or CGI-enable
d (lines 6 13). The function call in line 15 passes one argument, a value for name
, to function generateWebsite. The function uses the default values given in the
definition for the other parameters. The function call in lines 17 18 passes thre
e arguments to generateWebsite. Variable name again has the value "Deitel". The
call also assigns the value "yes" to keyword argument Flash and "www.deitel.com/
new" to keyword argument url. This function call illustrates that the order of k
eyword arguments is more flexible than that of regular arguments in an ordinary
function call. The Python interpreter matches the value "Deitel" with variable n
ame by its position in the function call. The Python interpreter matches the val
ues passed to url and Flash by their keyword argument names rather than by their
positions in the function call. The value of name must come first in any call t
o generateWebsite if it is not referenced by specifying a value for name in the
argument list. Line 20 demonstrates that any function argument can be referenced
as a keyword even if it has no default value. The interactive session of Fig. 4
.22 demonstrates common errors when mixing nonkeyword and keyword arguments. Fun
ction call test( number1 = "two", "Name" ) causes an error, because the non-keyw
ord argument is placed after the keyword argument. Function call test( number1 =
"three" ) is incorrect, becauFunction generateWebsite takes four arguments. The
keyword argument names url, Flash and CGI are assigned the default values "www.
deitel.com", "no" and "yes", respectively (lines 4 5). The function identifies who
is requesting the Web site and displays a message if the Web site is Flash- or
CGI-enabled (lines 6 13). The function call in line 15 passes one argument, a valu
e for name, to function generateWebsite. The function uses the default values gi
ven in the definition for the other parameters. The function call in lines 17 18 p
asses three arguments to generateWebsite. Variable name again has the value "Dei

tel". The call also assigns the value "yes" to keyword argument Flash and "www.d
eitel.com/new" to keyword argument url. This function call illustrates that the
order of keyword arguments is more flexible than that of regular arguments in an
ordinary function call. The Python interpreter matches the value "Deitel" with
variable name by its position in the function call. The Python interpreter match
es the values passed to url and Flash by their keyword argument names rather tha
n by their positions in the function call. The value of name must come first in
any call to generateWebsite if it is not referenced by specifying a value for na
me in the argument list. Line 20 demonstrates that any function argument can be
referenced as a keyword even if it has no default value. The interactive session
of Fig. 4.22 demonstrates common errors when mixing nonkeyword and keyword argu
ments. Function call test( number1 = "two", "Name" ) causes an error, because th
e non-keyword argument is placed after the keyword argument. Function call test(
number1 = "three" ) is incorrect, becauFunction generateWebsite takes four argu
ments. The keyword argument names url, Flash and CGI are assigned the default va
lues "www.deitel.com", "no" and "yes", respectively (lines 4 5). The function iden
tifies who is requesting the Web site and displays a message if the Web site is
Flash- or CGI-enabled (lines 6 13). The function call in line 15 passes one argume
nt, a value for name, to function generateWebsite. The function uses the default
values given in the definition for the other parameters. The function call in l
ines 17 18 passes three arguments to generateWebsite. Variable name again has the
value "Deitel". The call also assigns the value "yes" to keyword argument Flash
and "www.deitel.com/new" to keyword argument url. This function call illustrates
that the order of keyword arguments is more flexible than that of regular argum
ents in an ordinary function call. The Python interpreter matches the value "Dei
tel" with variable name by its position in the function call. The Python interpr
eter matches the values passed to url and Flash by their keyword argument names
rather than by their positions in the function call. The value of name must come
first in any call to generateWebsite if it is not referenced by specifying a va
lue for name in the argument list. Line 20 demonstrates that any function argume
nt can be referenced as a keyword even if it has no default value. The interacti
ve session of Fig. 4.22 demonstrates common errors when mixing nonkeyword and ke
yword arguments. Function call test( number1 = "two", "Name" ) causes an error,
because the non-keyword argument is placed after the keyword argument. Function
call test( number1 = "three" ) is incorrect, becauFunction generateWebsite takes
four arguments. The keyword argument names url, Flash and CGI are assigned the
default values "www.deitel.com", "no" and "yes", respectively (lines 4 5). The fun
ction identifies who is requesting the Web site and displays a message if the We
b site is Flash- or CGI-enabled (lines 6 13). The function call in line 15 passes
one argument, a value for name, to function generateWebsite. The function uses t
he default values given in the definition for the other parameters. The function
call in lines 17 18 passes three arguments to generateWebsite. Variable name agai
n has the value "Deitel". The call also assigns the value "yes" to keyword argum
ent Flash and "www.deitel.com/new" to keyword argument url. This function call i
llustrates that the order of keyword arguments is more flexible than that of reg
ular arguments in an ordinary function call. The Python interpreter matches the
value "Deitel" with variable name by its position in the function call. The Pyth
on interpreter matches the values passed to url and Flash by their keyword argum
ent names rather than by their positions in the function call. The value of name
must come first in any call to generateWebsite if it is not referenced by speci
fying a value for name in the argument list. Line 20 demonstrates that any funct
ion argument can be referenced as a keyword even if it has no default value. The
interactive session of Fig. 4.22 demonstrates common errors when mixing nonkeyw
ord and keyword arguments. Function call test( number1 = "two", "Name" ) causes
an error, because the non-keyword argument is placed after the keyword argument.
Function call test( number1 = "three" ) is incorrect, becauFunction generateWeb
site takes four arguments. The keyword argument names url, Flash and CGI are ass
igned the default values "www.deitel.com", "no" and "yes", respectively (lines 4 5
). The function identifies who is requesting the Web site and displays a message
if the Web site is Flash- or CGI-enabled (lines 6 13). The function call in line

15 passes one argument, a value for name, to function generateWebsite. The funct
ion uses the default values given in the definition for the other parameters. Th
e function call in lines 17 18 passes three arguments to generateWebsite. Variable
name again has the value "Deitel". The call also assigns the value "yes" to key
word argument Flash and "www.deitel.com/new" to keyword argument url. This funct
ion call illustrates that the order of keyword arguments is more flexible than t
hat of regular arguments in an ordinary function call. The Python interpreter ma
tches the value "Deitel" with variable name by its position in the function call
. The Python interpreter matches the values passed to url and Flash by their key
word argument names rather than by their positions in the function call. The val
ue of name must come first in any call to generateWebsite if it is not reference
d by specifying a value for name in the argument list. Line 20 demonstrates that
any function argument can be referenced as a keyword even if it has no default
value. The interactive session of Fig. 4.22 demonstrates common errors when mixi
ng nonkeyword and keyword arguments. Function call test( number1 = "two", "Name"
) causes an error, because the non-keyword argument is placed after the keyword
argument. Function call test( number1 = "three" ) is incorrect, becauFunction g
enerateWebsite takes four arguments. The keyword argument names url, Flash and C
GI are assigned the default values "www.deitel.com", "no" and "yes", respectivel
y (lines 4 5). The function identifies who is requesting the Web site and displays
a message if the Web site is Flash- or CGI-enabled (lines 6 13). The function cal
l in line 15 passes one argument, a value for name, to function generateWebsite.
The function uses the default values given in the definition for the other para
meters. The function call in lines 17 18 passes three arguments to generateWebsite
. Variable name again has the value "Deitel". The call also assigns the value "y
es" to keyword argument Flash and "www.deitel.com/new" to keyword argument url.
This function call illustrates that the order of keyword arguments is more flexi
ble than that of regular arguments in an ordinary function call. The Python inte
rpreter matches the value "Deitel" with variable name by its position in the fun
ction call. The Python interpreter matches the values passed to url and Flash by
their keyword argument names rather than by their positions in the function cal
l. The value of name must come first in any call to generateWebsite if it is not
referenced by specifying a value for name in the argument list. Line 20 demonst
rates that any function argument can be referenced as a keyword even if it has n
o default value. The interactive session of Fig. 4.22 demonstrates common errors
when mixing nonkeyword and keyword arguments. Function call test( number1 = "tw
o", "Name" ) causes an error, because the non-keyword argument is placed after t
he keyword argument. Function call test( number1 = "three" ) is incorrect, becau
Function generateWebsite takes four arguments. The keyword argument names url, F
lash and CGI are assigned the default values "www.deitel.com", "no" and "yes", r
espectively (lines 4 5). The function identifies who is requesting the Web site an
d displays a message if the Web site is Flash- or CGI-enabled (lines 6 13). The fu
nction call in line 15 passes one argument, a value for name, to function genera
teWebsite. The function uses the default values given in the definition for the
other parameters. The function call in lines 17 18 passes three arguments to gener
ateWebsite. Variable name again has the value "Deitel". The call also assigns th
e value "yes" to keyword argument Flash and "www.deitel.com/new" to keyword argu
ment url. This function call illustrates that the order of keyword arguments is
more flexible than that of regular arguments in an ordinary function call. The P
ython interpreter matches the value "Deitel" with variable name by its position
in the function call. The Python interpreter matches the values passed to url an
d Flash by their keyword argument names rather than by their positions in the fu
nction call. The value of name must come first in any call to generateWebsite if
it is not referenced by specifying a value for name in the argument list. Line
20 demonstrates that any function argument can be referenced as a keyword even i
f it has no default value. The interactive session of Fig. 4.22 demonstrates com
mon errors when mixing nonkeyword and keyword arguments. Function call test( num
ber1 = "two", "Name" ) causes an error, because the non-keyword argument is plac
ed after the keyword argument. Function call test( number1 = "three" ) is incorr
ect, becauFunction generateWebsite takes four arguments. The keyword argument na

mes url, Flash and CGI are assigned the default values "www.deitel.com", "no" an
d "yes", respectively (lines 4 5). The function identifies who is requesting the W
eb site and displays a message if the Web site is Flash- or CGI-enabled (lines 6 1
3). The function call in line 15 passes one argument, a value for name, to funct
ion generateWebsite. The function uses the default values given in the definitio
n for the other parameters. The function call in lines 17 18 passes three argument
s to generateWebsite. Variable name again has the value "Deitel". The call also
assigns the value "yes" to keyword argument Flash and "www.deitel.com/new" to ke
yword argument url. This function call illustrates that the order of keyword arg
uments is more flexible than that of regular arguments in an ordinary function c
all. The Python interpreter matches the value "Deitel" with variable name by its
position in the function call. The Python interpreter matches the values passed
to url and Flash by their keyword argument names rather than by their positions
in the function call. The value of name must come first in any call to generate
Website if it is not referenced by specifying a value for name in the argument l
ist. Line 20 demonstrates that any function argument can be referenced as a keyw
ord even if it has no default value. The interactive session of Fig. 4.22 demons
trates common errors when mixing nonkeyword and keyword arguments. Function call
test( number1 = "two", "Name" ) causes an error, because the non-keyword argume
nt is placed after the keyword argument. Function call test( number1 = "three" )
is incorrect, becauFunction generateWebsite takes four arguments. The keyword a
rgument names url, Flash and CGI are assigned the default values "www.deitel.com
", "no" and "yes", respectively (lines 4 5). The function identifies who is reques
ting the Web site and displays a message if the Web site is Flash- or CGI-enable
d (lines 6 13). The function call in line 15 passes one argument, a value for name
, to function generateWebsite. The function uses the default values given in the
definition for the other parameters. The function call in lines 17 18 passes thre
e arguments to generateWebsite. Variable name again has the value "Deitel". The
call also assigns the value "yes" to keyword argument Flash and "www.deitel.com/
new" to keyword argument url. This function call illustrates that the order of k
eyword arguments is more flexible than that of regular arguments in an ordinary
function call. The Python interpreter matches the value "Deitel" with variable n
ame by its position in the function call. The Python interpreter matches the val
ues passed to url and Flash by their keyword argument names rather than by their
positions in the function call. The value of name must come first in any call t
o generateWebsite if it is not referenced by specifying a value for name in the
argument list. Line 20 demonstrates that any function argument can be referenced
as a keyword even if it has no default value. The interactive session of Fig. 4
.22 demonstrates common errors when mixing nonkeyword and keyword arguments. Fun
ction call test( number1 = "two", "Name" ) causes an error, because the non-keyw
ord argument is placed after the keyword argument. Function call test( number1 =
"three" ) is incorrect, becauFunction generateWebsite takes four arguments. The
keyword argument names url, Flash and CGI are assigned the default values "www.
deitel.com", "no" and "yes", respectively (lines 4 5). The function identifies who
is requesting the Web site and displays a message if the Web site is Flash- or
CGI-enabled (lines 6 13). The function call in line 15 passes one argument, a valu
e for name, to function generateWebsite. The function uses the default values gi
ven in the definition for the other parameters. The function call in lines 17 18 p
asses three arguments to generateWebsite. Variable name again has the value "Dei
tel". The call also assigns the value "yes" to keyword argument Flash and "www.d
eitel.com/new" to keyword argument url. This function call illustrates that the
order of keyword arguments is more flexible than that of regular arguments in an
ordinary function call. The Python interpreter matches the value "Deitel" with
variable name by its position in the function call. The Python interpreter match
es the values passed to url and Flash by their keyword argument names rather tha
n by their positions in the function call. The value of name must come first in
any call to generateWebsite if it is not referenced by specifying a value for na
me in the argument list. Line 20 demonstrates that any function argument can be
referenced as a keyword even if it has no default value. The interactive session
of Fig. 4.22 demonstrates common errors when mixing nonkeyword and keyword argu

ments. Function call test( number1 = "two", "Name" ) causes an error, because th
e non-keyword argument is placed after the keyword argument. Function call test(
number1 = "three" ) is incorrect, becauFunction generateWebsite takes four argu
ments. The keyword argument names url, Flash and CGI are assigned the default va
lues "www.deitel.com", "no" and "yes", respectively (lines 4 5). The function iden
tifies who is requesting the Web site and displays a message if the Web site is
Flash- or CGI-enabled (lines 6 13). The function call in line 15 passes one argume
nt, a value for name, to function generateWebsite. The function uses the default
values given in the definition for the other parameters. The function call in l
ines 17 18 passes three arguments to generateWebsite. Variable name again has the
value "Deitel". The call also assigns the value "yes" to keyword argument Flash
and "www.deitel.com/new" to keyword argument url. This function call illustrates
that the order of keyword arguments is more flexible than that of regular argum
ents in an ordinary function call. The Python interpreter matches the value "Dei
tel" with variable name by its position in the function call. The Python interpr
eter matches the values passed to url and Flash by their keyword argument names
rather than by their positions in the function call. The value of name must come
first in any call to generateWebsite if it is not referenced by specifying a va
lue for name in the argument list. Line 20 demonstrates that any function argume
nt can be referenced as a keyword even if it has no default value. The interacti
ve session of Fig. 4.22 demonstrates common errors when mixing nonkeyword and ke
yword arguments. Function call test( number1 = "two", "Name" ) causes an error,
because the non-keyword argument is placed after the keyword argument. Function
call test( number1 = "three" ) is incorrect, becauFunction generateWebsite takes
four arguments. The keyword argument names url, Flash and CGI are assigned the
default values "www.deitel.com", "no" and "yes", respectively (lines 4 5). The fun
ction identifies who is requesting the Web site and displays a message if the We
b site is Flash- or CGI-enabled (lines 6 13). The function call in line 15 passes
one argument, a value for name, to function generateWebsite. The function uses t
he default values given in the definition for the other parameters. The function
call in lines 17 18 passes three arguments to generateWebsite. Variable name agai
n has the value "Deitel". The call also assigns the value "yes" to keyword argum
ent Flash and "www.deitel.com/new" to keyword argument url. This function call i
llustrates that the order of keyword arguments is more flexible than that of reg
ular arguments in an ordinary function call. The Python interpreter matches the
value "Deitel" with variable name by its position in the function call. The Pyth
on interpreter matches the values passed to url and Flash by their keyword argum
ent names rather than by their positions in the function call. The value of name
must come first in any call to generateWebsite if it is not referenced by speci
fying a value for name in the argument list. Line 20 demonstrates that any funct
ion argument can be referenced as a keyword even if it has no default value. The
interactive session of Fig. 4.22 demonstrates common errors when mixing nonkeyw
ord and keyword arguments. Function call test( number1 = "two", "Name" ) causes
an error, because the non-keyword argument is placed after the keyword argument.
Function call test( number1 = "three" ) is incorrect, becauFunction generateWeb
site takes four arguments. The keyword argument names url, Flash and CGI are ass
igned the default values "www.deitel.com", "no" and "yes", respectively (lines 4 5
). The function identifies who is requesting the Web site and displays a message
if the Web site is Flash- or CGI-enabled (lines 6 13). The function call in line
15 passes one argument, a value for name, to function generateWebsite. The funct
ion uses the default values given in the definition for the other parameters. Th
e function call in lines 17 18 passes three arguments to generateWebsite. Variable
name again has the value "Deitel". The call also assigns the value "yes" to key
word argument Flash and "www.deitel.com/new" to keyword argument url. This funct
ion call illustrates that the order of keyword arguments is more flexible than t
hat of regular arguments in an ordinary function call. The Python interpreter ma
tches the value "Deitel" with variable name by its position in the function call
. The Python interpreter matches the values passed to url and Flash by their key
word argument names rather than by their positions in the function call. The val
ue of name must come first in any call to generateWebsite if it is not reference

d by specifying a value for name in the argument list. Line 20 demonstrates that
any function argument can be referenced as a keyword even if it has no default
value. The interactive session of Fig. 4.22 demonstrates common errors when mixi
ng nonkeyword and keyword arguments. Function call test( number1 = "two", "Name"
) causes an error, because the non-keyword argument is placed after the keyword
argument. Function call test( number1 = "three" ) is incorrect, becauFunction g
enerateWebsite takes four arguments. The keyword argument names url, Flash and C
GI are assigned the default values "www.deitel.com", "no" and "yes", respectivel
y (lines 4 5). The function identifies who is requesting the Web site and displays
a message if the Web site is Flash- or CGI-enabled (lines 6 13). The function cal
l in line 15 passes one argument, a value for name, to function generateWebsite.
The function uses the default values given in the definition for the other para
meters. The function call in lines 17 18 passes three arguments to generateWebsite
. Variable name again has the value "Deitel". The call also assigns the value "y
es" to keyword argument Flash and "www.deitel.com/new" to keyword argument url.
This function call illustrates that the order of keyword arguments is more flexi
ble than that of regular arguments in an ordinary function call. The Python inte
rpreter matches the value "Deitel" with variable name by its position in the fun
ction call. The Python interpreter matches the values passed to url and Flash by
their keyword argument names rather than by their positions in the function cal
l. The value of name must come first in any call to generateWebsite if it is not
referenced by specifying a value for name in the argument list. Line 20 demonst
rates that any function argument can be referenced as a keyword even if it has n
o default value. The interactive session of Fig. 4.22 demonstrates common errors
when mixing nonkeyword and keyword arguments. Function call test( number1 = "tw
o", "Name" ) causes an error, because the non-keyword argument is placed after t
he keyword argument. Function call test( number1 = "three" ) is incorrect, becau
Function generateWebsite takes four arguments. The keyword argument names url, F
lash and CGI are assigned the default values "www.deitel.com", "no" and "yes", r
espectively (lines 4 5). The function identifies who is requesting the Web site an
d displays a message if the Web site is Flash- or CGI-enabled (lines 6 13). The fu
nction call in line 15 passes one argument, a value for name, to function genera
teWebsite. The function uses the default values given in the definition for the
other parameters. The function call in lines 17 18 passes three arguments to gener
ateWebsite. Variable name again has the value "Deitel". The call also assigns th
e value "yes" to keyword argument Flash and "www.deitel.com/new" to keyword argu
ment url. This function call illustrates that the order of keyword arguments is
more flexible than that of regular arguments in an ordinary function call. The P
ython interpreter matches the value "Deitel" with variable name by its position
in the function call. The Python interpreter matches the values passed to url an
d Flash by their keyword argument names rather than by their positions in the fu
nction call. The value of name must come first in any call to generateWebsite if
it is not referenced by specifying a value for name in the argument list. Line
20 demonstrates that any function argument can be referenced as a keyword even i
f it has no default value. The interactive session of Fig. 4.22 demonstrates com
mon errors when mixing nonkeyword and keyword arguments. Function call test( num
ber1 = "two", "Name" ) causes an error, because the non-keyword argument is plac
ed after the keyword argument. Function call test( number1 = "three" ) is incorr
ect, becauFunction generateWebsite takes four arguments. The keyword argument na
mes url, Flash and CGI are assigned the default values "www.deitel.com", "no" an
d "yes", respectively (lines 4 5). The function identifies who is requesting the W
eb site and displays a message if the Web site is Flash- or CGI-enabled (lines 6 1
3). The function call in line 15 passes one argument, a value for name, to funct
ion generateWebsite. The function uses the default values given in the definitio
n for the other parameters. The function call in lines 17 18 passes three argument
s to generateWebsite. Variable name again has the value "Deitel". The call also
assigns the value "yes" to keyword argument Flash and "www.deitel.com/new" to ke
yword argument url. This function call illustrates that the order of keyword arg
uments is more flexible than that of regular arguments in an ordinary function c
all. The Python interpreter matches the value "Deitel" with variable name by its

position in the function call. The Python interpreter matches the values passed
to url and Flash by their keyword argument names rather than by their positions
in the function call. The value of name must come first in any call to generate
Website if it is not referenced by specifying a value for name in the argument l
ist. Line 20 demonstrates that any function argument can be referenced as a keyw
ord even if it has no default value. The interactive session of Fig. 4.22 demons
trates common errors when mixing nonkeyword and keyword arguments. Function call
test( number1 = "two", "Name" ) causes an error, because the non-keyword argume
nt is placed after the keyword argument. Function call test( number1 = "three" )
is incorrect, becauFunction generateWebsite takes four arguments. The keyword a
rgument names url, Flash and CGI are assigned the default values "www.deitel.com
", "no" and "yes", respectively (lines 4 5). The function identifies who is reques
ting the Web site and displays a message if the Web site is Flash- or CGI-enable
d (lines 6 13). The function call in line 15 passes one argument, a value for name
, to function generateWebsite. The function uses the default values given in the
definition for the other parameters. The function call in lines 17 18 passes thre
e arguments to generateWebsite. Variable name again has the value "Deitel". The
call also assigns the value "yes" to keyword argument Flash and "www.deitel.com/
new" to keyword argument url. This function call illustrates that the order of k
eyword arguments is more flexible than that of regular arguments in an ordinary
function call. The Python interpreter matches the value "Deitel" with variable n
ame by its position in the function call. The Python interpreter matches the val
ues passed to url and Flash by their keyword argument names rather than by their
positions in the function call. The value of name must come first in any call t
o generateWebsite if it is not referenced by specifying a value for name in the
argument list. Line 20 demonstrates that any function argument can be referenced
as a keyword even if it has no default value. The interactive session of Fig. 4
.22 demonstrates common errors when mixing nonkeyword and keyword arguments. Fun
ction call test( number1 = "two", "Name" ) causes an error, because the non-keyw
ord argument is placed after the keyword argument. Function call test( number1 =
"three" ) is incorrect, becauFunction generateWebsite takes four arguments. The
keyword argument names url, Flash and CGI are assigned the default values "www.
deitel.com", "no" and "yes", respectively (lines 4 5). The function identifies who
is requesting the Web site and displays a message if the Web site is Flash- or
CGI-enabled (lines 6 13). The function call in line 15 passes one argument, a valu
e for name, to function generateWebsite. The function uses the default values gi
ven in the definition for the other parameters. The function call in lines 17 18 p
asses three arguments to generateWebsite. Variable name again has the value "Dei
tel". The call also assigns the value "yes" to keyword argument Flash and "www.d
eitel.com/new" to keyword argument url. This function call illustrates that the
order of keyword arguments is more flexible than that of regular arguments in an
ordinary function call. The Python interpreter matches the value "Deitel" with
variable name by its position in the function call. The Python interpreter match
es the values passed to url and Flash by their keyword argument names rather tha
n by their positions in the function call. The value of name must come first in
any call to generateWebsite if it is not referenced by specifying a value for na
me in the argument list. Line 20 demonstrates that any function argument can be
referenced as a keyword even if it has no default value. The interactive session
of Fig. 4.22 demonstrates common errors when mixing nonkeyword and keyword argu
ments. Function call test( number1 = "two", "Name" ) causes an error, because th
e non-keyword argument is placed after the keyword argument. Function call test(
number1 = "three" ) is incorrect, becauFunction generateWebsite takes four argu
ments. The keyword argument names url, Flash and CGI are assigned the default va
lues "www.deitel.com", "no" and "yes", respectively (lines 4 5). The function iden
tifies who is requesting the Web site and displays a message if the Web site is
Flash- or CGI-enabled (lines 6 13). The function call in line 15 passes one argume
nt, a value for name, to function generateWebsite. The function uses the default
values given in the definition for the other parameters. The function call in l
ines 17 18 passes three arguments to generateWebsite. Variable name again has the
value "Deitel". The call also assigns the value "yes" to keyword argument Flash

and "www.deitel.com/new" to keyword argument url. This function call illustrates


that the order of keyword arguments is more flexible than that of regular argum
ents in an ordinary function call. The Python interpreter matches the value "Dei
tel" with variable name by its position in the function call. The Python interpr
eter matches the values passed to url and Flash by their keyword argument names
rather than by their positions in the function call. The value of name must come
first in any call to generateWebsite if it is not referenced by specifying a va
lue for name in the argument list. Line 20 demonstrates that any function argume
nt can be referenced as a keyword even if it has no default value. The interacti
ve session of Fig. 4.22 demonstrates common errors when mixing nonkeyword and ke
yword arguments. Function call test( number1 = "two", "Name" ) causes an error,
because the non-keyword argument is placed after the keyword argument. Function
call test( number1 = "three" ) is incorrect, becauFunction generateWebsite takes
four arguments. The keyword argument names url, Flash and CGI are assigned the
default values "www.deitel.com", "no" and "yes", respectively (lines 4 5). The fun
ction identifies who is requesting the Web site and displays a message if the We
b site is Flash- or CGI-enabled (lines 6 13). The function call in line 15 passes
one argument, a value for name, to function generateWebsite. The function uses t
he default values given in the definition for the other parameters. The function
call in lines 17 18 passes three arguments to generateWebsite. Variable name agai
n has the value "Deitel". The call also assigns the value "yes" to keyword argum
ent Flash and "www.deitel.com/new" to keyword argument url. This function call i
llustrates that the order of keyword arguments is more flexible than that of reg
ular arguments in an ordinary function call. The Python interpreter matches the
value "Deitel" with variable name by its position in the function call. The Pyth
on interpreter matches the values passed to url and Flash by their keyword argum
ent names rather than by their positions in the function call. The value of name
must come first in any call to generateWebsite if it is not referenced by speci
fying a value for name in the argument list. Line 20 demonstrates that any funct
ion argument can be referenced as a keyword even if it has no default value. The
interactive session of Fig. 4.22 demonstrates common errors when mixing nonkeyw
ord and keyword arguments. Function call test( number1 = "two", "Name" ) causes
an error, because the non-keyword argument is placed after the keyword argument.
Function call test( number1 = "three" ) is incorrect, becauFunction generateWeb
site takes four arguments. The keyword argument names url, Flash and CGI are ass
igned the default values "www.deitel.com", "no" and "yes", respectively (lines 4 5
). The function identifies who is requesting the Web site and displays a message
if the Web site is Flash- or CGI-enabled (lines 6 13). The function call in line
15 passes one argument, a value for name, to function generateWebsite. The funct
ion uses the default values given in the definition for the other parameters. Th
e function call in lines 17 18 passes three arguments to generateWebsite. Variable
name again has the value "Deitel". The call also assigns the value "yes" to key
word argument Flash and "www.deitel.com/new" to keyword argument url. This funct
ion call illustrates that the order of keyword arguments is more flexible than t
hat of regular arguments in an ordinary function call. The Python interpreter ma
tches the value "Deitel" with variable name by its position in the function call
. The Python interpreter matches the values passed to url and Flash by their key
word argument names rather than by their positions in the function call. The val
ue of name must come first in any call to generateWebsite if it is not reference
d by specifying a value for name in the argument list. Line 20 demonstrates that
any function argument can be referenced as a keyword even if it has no default
value. The interactive session of Fig. 4.22 demonstrates common errors when mixi
ng nonkeyword and keyword arguments. Function call test( number1 = "two", "Name"
) causes an error, because the non-keyword argument is placed after the keyword
argument. Function call test( number1 = "three" ) is incorrect, becauFunction g
enerateWebsite takes four arguments. The keyword argument names url, Flash and C
GI are assigned the default values "www.deitel.com", "no" and "yes", respectivel
y (lines 4 5). The function identifies who is requesting the Web site and displays
a message if the Web site is Flash- or CGI-enabled (lines 6 13). The function cal
l in line 15 passes one argument, a value for name, to function generateWebsite.

The function uses the default values given in the definition for the other para
meters. The function call in lines 17 18 passes three arguments to generateWebsite
. Variable name again has the value "Deitel". The call also assigns the value "y
es" to keyword argument Flash and "www.deitel.com/new" to keyword argument url.
This function call illustrates that the order of keyword arguments is more flexi
ble than that of regular arguments in an ordinary function call. The Python inte
rpreter matches the value "Deitel" with variable name by its position in the fun
ction call. The Python interpreter matches the values passed to url and Flash by
their keyword argument names rather than by their positions in the function cal
l. The value of name must come first in any call to generateWebsite if it is not
referenced by specifying a value for name in the argument list. Line 20 demonst
rates that any function argument can be referenced as a keyword even if it has n
o default value. The interactive session of Fig. 4.22 demonstrates common errors
when mixing nonkeyword and keyword arguments. Function call test( number1 = "tw
o", "Name" ) causes an error, because the non-keyword argument is placed after t
he keyword argument. Function call test( number1 = "three" ) is incorrect, becau
Function generateWebsite takes four arguments. The keyword argument names url, F
lash and CGI are assigned the default values "www.deitel.com", "no" and "yes", r
espectively (lines 4 5). The function identifies who is requesting the Web site an
d displays a message if the Web site is Flash- or CGI-enabled (lines 6 13). The fu
nction call in line 15 passes one argument, a value for name, to function genera
teWebsite. The function uses the default values given in the definition for the
other parameters. The function call in lines 17 18 passes three arguments to gener
ateWebsite. Variable name again has the value "Deitel". The call also assigns th
e value "yes" to keyword argument Flash and "www.deitel.com/new" to keyword argu
ment url. This function call illustrates that the order of keyword arguments is
more flexible than that of regular arguments in an ordinary function call. The P
ython interpreter matches the value "Deitel" with variable name by its position
in the function call. The Python interpreter matches the values passed to url an
d Flash by their keyword argument names rather than by their positions in the fu
nction call. The value of name must come first in any call to generateWebsite if
it is not referenced by specifying a value for name in the argument list. Line
20 demonstrates that any function argument can be referenced as a keyword even i
f it has no default value. The interactive session of Fig. 4.22 demonstrates com
mon errors when mixing nonkeyword and keyword arguments. Function call test( num
ber1 = "two", "Name" ) causes an error, because the non-keyword argument is plac
ed after the keyword argument. Function call test( number1 = "three" ) is incorr
ect, becauFunction generateWebsite takes four arguments. The keyword argument na
mes url, Flash and CGI are assigned the default values "www.deitel.com", "no" an
d "yes", respectively (lines 4 5). The function identifies who is requesting the W
eb site and displays a message if the Web site is Flash- or CGI-enabled (lines 6 1
3). The function call in line 15 passes one argument, a value for name, to funct
ion generateWebsite. The function uses the default values given in the definitio
n for the other parameters. The function call in lines 17 18 passes three argument
s to generateWebsite. Variable name again has the value "Deitel". The call also
assigns the value "yes" to keyword argument Flash and "www.deitel.com/new" to ke
yword argument url. This function call illustrates that the order of keyword arg
uments is more flexible than that of regular arguments in an ordinary function c
all. The Python interpreter matches the value "Deitel" with variable name by its
position in the function call. The Python interpreter matches the values passed
to url and Flash by their keyword argument names rather than by their positions
in the function call. The value of name must come first in any call to generate
Website if it is not referenced by specifying a value for name in the argument l
ist. Line 20 demonstrates that any function argument can be referenced as a keyw
ord even if it has no default value. The interactive session of Fig. 4.22 demons
trates common errors when mixing nonkeyword and keyword arguments. Function call
test( number1 = "two", "Name" ) causes an error, because the non-keyword argume
nt is placed after the keyword argument. Function call test( number1 = "three" )
is incorrect, becauFunction generateWebsite takes four arguments. The keyword a
rgument names url, Flash and CGI are assigned the default values "www.deitel.com

", "no" and "yes", respectively (lines 4 5). The function identifies who is reques
ting the Web site and displays a message if the Web site is Flash- or CGI-enable
d (lines 6 13). The function call in line 15 passes one argument, a value for name
, to function generateWebsite. The function uses the default values given in the
definition for the other parameters. The function call in lines 17 18 passes thre
e arguments to generateWebsite. Variable name again has the value "Deitel". The
call also assigns the value "yes" to keyword argument Flash and "www.deitel.com/
new" to keyword argument url. This function call illustrates that the order of k
eyword arguments is more flexible than that of regular arguments in an ordinary
function call. The Python interpreter matches the value "Deitel" with variable n
ame by its position in the function call. The Python interpreter matches the val
ues passed to url and Flash by their keyword argument names rather than by their
positions in the function call. The value of name must come first in any call t
o generateWebsite if it is not referenced by specifying a value for name in the
argument list. Line 20 demonstrates that any function argument can be referenced
as a keyword even if it has no default value. The interactive session of Fig. 4
.22 demonstrates common errors when mixing nonkeyword and keyword arguments. Fun
ction call test( number1 = "two", "Name" ) causes an error, because the non-keyw
ord argument is placed after the keyword argument. Function call test( number1 =
"three" ) is incorrect, becauFunction generateWebsite takes four arguments. The
keyword argument names url, Flash and CGI are assigned the default values "www.
deitel.com", "no" and "yes", respectively (lines 4 5). The function identifies who
is requesting the Web site and displays a message if the Web site is Flash- or
CGI-enabled (lines 6 13). The function call in line 15 passes one argument, a valu
e for name, to function generateWebsite. The function uses the default values gi
ven in the definition for the other parameters. The function call in lines 17 18 p
asses three arguments to generateWebsite. Variable name again has the value "Dei
tel". The call also assigns the value "yes" to keyword argument Flash and "www.d
eitel.com/new" to keyword argument url. This function call illustrates that the
order of keyword arguments is more flexible than that of regular arguments in an
ordinary function call. The Python interpreter matches the value "Deitel" with
variable name by its position in the function call. The Python interpreter match
es the values passed to url and Flash by their keyword argument names rather tha
n by their positions in the function call. The value of name must come first in
any call to generateWebsite if it is not referenced by specifying a value for na
me in the argument list. Line 20 demonstrates that any function argument can be
referenced as a keyword even if it has no default value. The interactive session
of Fig. 4.22 demonstrates common errors when mixing nonkeyword and keyword argu
ments. Function call test( number1 = "two", "Name" ) causes an error, because th
e non-keyword argument is placed after the keyword argument. Function call test(
number1 = "three" ) is incorrect, becauFunction generateWebsite takes four argu
ments. The keyword argument names url, Flash and CGI are assigned the default va
lues "www.deitel.com", "no" and "yes", respectively (lines 4 5). The function iden
tifies who is requesting the Web site and displays a message if the Web site is
Flash- or CGI-enabled (lines 6 13). The function call in line 15 passes one argume
nt, a value for name, to function generateWebsite. The function uses the default
values given in the definition for the other parameters. The function call in l
ines 17 18 passes three arguments to generateWebsite. Variable name again has the
value "Deitel". The call also assigns the value "yes" to keyword argument Flash
and "www.deitel.com/new" to keyword argument url. This function call illustrates
that the order of keyword arguments is more flexible than that of regular argum
ents in an ordinary function call. The Python interpreter matches the value "Dei
tel" with variable name by its position in the function call. The Python interpr
eter matches the values passed to url and Flash by their keyword argument names
rather than by their positions in the function call. The value of name must come
first in any call to generateWebsite if it is not referenced by specifying a va
lue for name in the argument list. Line 20 demonstrates that any function argume
nt can be referenced as a keyword even if it has no default value. The interacti
ve session of Fig. 4.22 demonstrates common errors when mixing nonkeyword and ke
yword arguments. Function call test( number1 = "two", "Name" ) causes an error,

because the non-keyword argument is placed after the keyword argument. Function
call test( number1 = "three" ) is incorrect, becauFunction generateWebsite takes
four arguments. The keyword argument names url, Flash and CGI are assigned the
default values "www.deitel.com", "no" and "yes", respectively (lines 4 5). The fun
ction identifies who is requesting the Web site and displays a message if the We
b site is Flash- or CGI-enabled (lines 6 13). The function call in line 15 passes
one argument, a value for name, to function generateWebsite. The function uses t
he default values given in the definition for the other parameters. The function
call in lines 17 18 passes three arguments to generateWebsite. Variable name agai
n has the value "Deitel". The call also assigns the value "yes" to keyword argum
ent Flash and "www.deitel.com/new" to keyword argument url. This function call i
llustrates that the order of keyword arguments is more flexible than that of reg
ular arguments in an ordinary function call. The Python interpreter matches the
value "Deitel" with variable name by its position in the function call. The Pyth
on interpreter matches the values passed to url and Flash by their keyword argum
ent names rather than by their positions in the function call. The value of name
must come first in any call to generateWebsite if it is not referenced by speci
fying a value for name in the argument list. Line 20 demonstrates that any funct
ion argument can be referenced as a keyword even if it has no default value. The
interactive session of Fig. 4.22 demonstrates common errors when mixing nonkeyw
ord and keyword arguments. Function call test( number1 = "two", "Name" ) causes
an error, because the non-keyword argument is placed after the keyword argument.
Function call test( number1 = "three" ) is incorrect, becau

You might also like