Oct-27-2018, 03:09 AM
Okay, you're receiving the error because of line 18. The last few lines of the traceback indicate that "if float(score) > 1.0" is generating the problem. Moreover, the problem is that "Quit" cannot be converted to a float. To fix this, you need to check for the entry "Quit" prior to calling float() on the score. Otherwise, you need to use a try...except block to catch the error and then check for "Quit".
As for your second problem, the return is currently inside your while loop. So, at the end of the first iteration, your function is returning the grade that it evaluated. It is returning prior to the second entry being evaluated.
For a critique, you have a lot of repetition in your code. Line 20, for instance, is repeated eight times. To improve your loop, try to refactor it to only have that line appear once.
As for your second problem, the return is currently inside your while loop. So, at the end of the first iteration, your function is returning the grade that it evaluated. It is returning prior to the second entry being evaluated.
For a critique, you have a lot of repetition in your code. Line 20, for instance, is repeated eight times. To improve your loop, try to refactor it to only have that line appear once.