id/email
password
forgot password
about | help | done | prefs | create account
CodingBat code practice

Python > List-2 > centered_average
prev  |  next  |  chance

Return the "centered" average of an array of ints, which we'll say is the mean average of the values, except not counting the largest and smallest values in the array. Use int division to produce the final average. You may assume that the array is length 3 or more.

centered_average([1, 2, 3, 4, 100]) → 3
centered_average([1, 1, 5, 5, 10, 8, 7]) → 5
centered_average([-10, -4, -2, -4, -2, 0]) → -3

...Save, Compile, Run

See also Python Example Code. Python help docs: Python Strings | Python Lists | Python If Boolean


prev  |  next  |  chance   |  CodingBat  >  List-2

Forget It! -- delete my code for this problem 209.0

Copyright Nick Parlante 2006-10 - privacy