Print those grades


#1

I think I'm doing it right but I get some error

grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]

def print_grades(grades):
    for grade in grades:
      print grade   
      print_grades(grades)

and the error: Oops, try again. Your print_grades function threw the following error: maximum recursion depth exceeded while calling a Python object


#2

Indentation error causes function to call itself (recursion) which is causing the issue. Remove indentation from the last line so that it is outside of the function.

def print_grades(grades):
    for grade in grades:
        print grade   
print_grades(grades)

#3

I was and still am having similar problems. I am getting the following error:

Oops, try again. It looks like your function did not print the grade: 100.

grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]
def print_grades(grades):
     for grade in grades:
          print grade

#4

Be sure that your indentation is correct (4 spaces per level) and that you call the print-grades() function:

print_grades(grades)