Consider:
def mean(values):
"""Return the arithmetic mean of the supplied values."""
total = 0
for value in values:
total = total + value
return total / len(values)
result = mean([2, 4, 9])
print(result)
State the exact printed output. In your explanation, identify:
[2 marks]
A student wants to calculate:
result = mean([2, 4, 9]) + 1
They suggest replacing the function’s final line with:
print(total / len(values))
Explain why printing the mean is not a suitable replacement for returning it in this use of the function. [2 marks]
After a successful call to the original function, a student adds:
print(total)
outside the function.
They argue: “The function has run, so total now exists and can be printed here.”
Explain why this reasoning is incorrect, and identify which variable outside the function holds the returned mean. [2 marks]
Suppose the call is changed to:
result = mean([])
Explain why the function cannot complete successfully as written. Describe a suitable way for the function to handle this case, and justify your choice. You do not need to write code. [2 marks]
The buyer-supplier relationship characterized by simple, routine exchanges with moderate levels of cooperation and information exchange is called _____.
One variant of systems selling is _____ where a single supplier provides the buyer with his or her entire requirement of MRO (maintenance, repair, operating) supplies.
The last stage in the industrial buying process is supplier selection.
The demand for business goods and services tends to be more volatile than the demand for consumer goods and services.