here if the contents are weird (if negative decimal values are weird for your program), a basic average returns negative numbers like that:
(python in case you hadn't heard)
def build_array(length = 56, possible_contents = [1,2,0]):
n = 
for i in range(0, length):
return float(float(sum(num_list)) / len(num_list))
# ran in IDLE:
>>> get_avg(build_array(999, [-0.000027, -0.0000000001, 0]))
The size was 999, array contents were a random mix of -0.000027, -0.0000000001, and 0.
So 999 negative decimal values averaged out, gives us a result like that.
Hince the question: What was the size, and what did the array contain?
by chriswelborn: defined 'weird' in better context, explained 'array' contents.