# Python; Review, 9/9 Infinite Loop Help!

#1

No error messages, the code is stuck in a loop, Once I press run, it never loads or allows me to advance forward

``````

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

total = 0
for score in scores:
total += score

return average

``````

#2

those are not defined, and you dont need to make len(grades_input) a float on a division
just to try something, change â€śtotal = 0â€ť to â€śtotal = 0.0â€ť

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

total = 0.0
for score in scores:
total += score

return average

this is the output i have
100
100
90
40
80
100
85
70
90
65
90
85
50.5
None
1045.5
80.42307692307692

#3

Made the changes suggested (thanks for seeing those) However , still running and not finishing though. I have reset the exercise and after getting the prompt that â€śthe code has been movedâ€ť I have reset the code. Still no luck .

#4

Where is your indentation? Python relies upon indents to distinguish between code blocks and establish scope parameters.

For this exercise set aside concern for floats. The data contains a float so the program will assume that state by default.

As mentioned above, `scores` is not defined. Use `grades` for the argument in this function call.

This function should use the return value of the `grades_variance` function.

``print grades_std_deviation(grades_variance(grades))``

#5

Still getting this error message: See above.

Here is the updated code;

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

total = 0.0
for score in scores:
total += score

return average

``````

#6

Needs indent.

Likewise.

Again, likewise.

Fix the indentation, copy your code, go back to the previous lesson, Run and Next. If the code is present then check it for errors and complete it, else paste the code in and Run.

#7

Still unable to get this, the work environment keeps moving the code making it unable to run smoothly. I have tried going back until I donâ€™t get the moved code error as well as resetting the code. I keep losing my code every time.

#8

Hi pcalhoun,

I had the same problem. I have test my code in eclipise environment and it worked. my solution was to copy my code on txt file then to reset the exercise and then going back to the start and re-entering the code for each section. I was able re-enter the solution and was able to get the solution to work. I had to do this twice to get it work.

#9

Finally got it to work. Tested my code in eclipse then went and reset until I no longer received the error message. Input code and was able to move forward! Thanks!

#10

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.