Exam Statistics Four Bug(or my mistake)


#1

Here's the code. I tested it.
grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]
def grades_sum(scores):
total = 0
for i in range(len(grades)):
total += grades[i]
print total
grades_sum(grades)
This code is not working(into the system). Why?


#2

@ajaxwhiz08742,

Please re-edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

or even better use
= http://discuss.codecademy.com/t/using-backticks-to-format-your-code/3697

================================

grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]
def grades_sum(scores):
    total = 0
    for i in scores:
        print str(total) + " + " +str(i) +" = ",
        total += i
        print total
    print total

grades_sum(grades)

#4

The parameter is, scores but the function code is referring to grades. Fix and repost in a new reply if this doesn't solve it.