logo

Crowdly

Consider:   def mean(values):       """Return the arithmetic mean ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

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: 

  • the value supplied to values;
  • the final value of total;
  • what len(values) returns.

[2 marks] 

 

More questions like this

Want instant access to all verified answers on moodle1.maths.ed.ac.uk?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!