the title says everything
If the code has been moved you’ll need to reset until all code is restored back in the editor. Also, you need to post your code
it doesn’t have to do with my code, the problem is a bug in codecademy (i just found out)
as stated above you will need to keep resetting the code on every instance that the error message pops up until you get the code restored on all exercises. It took me a couple of tries before it worked. Once you get it reset you should be able to move forward. I was stuck on 9/9 of the exercise for a few days with the run button running until I figured out this solution. Yes, there is a bug but that is the solution to fix it if that is the problem. If it is your code remember that indentation is key in Python. If something isn’t indented correctly, it will cause the run button to loop as well check everything. I hope it works for you!! Please post if it works for you so that others may know as well!
it didn’t work, this is my code:
grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5] def print_grades(grades_input): for grade in grades_input: print grade def grades_sum(scores): total = 0 for score in scores: total += score return total def grades_average(grades_input): sum_of_grades = grades_sum(grades_input) average = sum_of_grades / float(len(grades_input)) return average def grades_variance(scores): average = grades_average(scores) variance = 0 for score in scores: variance += (average - score) ** 2 variance2 = variance/len(scores) return variance2 print grades_variance(grades) def grades_std_deviation(variance): result = variance ** 0.5 return result variance = grades_variance(grades) print grades_std_deviation(variance) print grades print grades_sum(grades) print grades_variance(grades)
I don’t see anything that is jumping right out at me in your code. I would keep trying the method I suggested as it worked for me. Also, you could try placing it in a .txt file and testing it in eclipse or another environment. That way if it runs you will know it isn’t the code.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.