which of the following statements is false?
Based on the following function definition that can receive an arbitrary number of arguments:
In [1]: def average(*args):
...: return sum(args) / len(args)
...:
a. The parameter name args is used by convention, but you may use any identifier.
b. If the function has multiple parameters, the *args parameter must be the leftmost one.
c. The following session calls average several times confirming that it works with arbitrary argument lists of different lengths:
In [2]: average(5, 10)
Out[2]: 7.5
In [3]: average(5, 10, 15)
Out[3]: 10.0
In [4]: average(5, 10, 15, 20)
Out[4]: 12.5
d. All of the above are true.
b. If the function has multiple parameters, the *args parameter must be the leftmost one.
You might also like to view...
What is the purpose of a printer separator page?
A) It prints a page at the start of a print job. B) It prints a test page to prove the printer is networked. C) It prints a test page to prove connectivity between a particular computer and a network printer. D) It is the paper that separates the toner from the transfer roller through the paper path.
What is the third step in logical troubleshooting?
A) Establish a theory of probable cause (question the user). B) Test the theory to determine the cause. C) Document findings, actions, and outcomes. D) Establish a plan of action.