forgot password
create account
Or use Mozilla Persona:

Mozilla Persona lets you create an account using your gmail or yahoo login, avoiding a separate Codingbat password.

about | help | code help+videos | done | prefs
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 ignoring the largest and smallest values in the array. If there are multiple copies of the smallest value, ignore just one copy, and likewise for the largest value. 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

Show output only (no red/green)

prev  |  next  |  chance   |  CodingBat  >  List-2

Forget It! -- delete my code for this problem

Progress graphs, just for fun:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help


Copyright Nick Parlante 2006-11 - privacy