<p dir="ltr"><br>
On Apr 20, 2014 8:01 PM, "Gregory Ewing" <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:<br>
><br>
> Ian Kelly wrote:<br>
><br>
>> def average(values):<br>
>>     return sum(values) / len(values)<br>
>><br>
>> This works for decimals, it works for fractions, it works for complex numbers, it works for numpy types, and in Python 3 it works for ints.<br>
><br>
><br>
> That depends on what you mean by "works". I would actually<br>
> find it rather disturbing if an average() function implicitly<br>
> used floor division when given all ints.</p>
<p dir="ltr">The code above never uses floor division in Python 3.  Therefore it "works".</p>