Why Do I Have to Use `float()`?


Why did I have to divide it by float(len(grades_input)) and not only len(grade_input)?

FAQ: Learn Python - Exam Statistics - Computing the Average

len() gives an integer, and if then the division involves two integers, python2 will return an integer (round down if needed), which is not desired