Common Gradescope Errors

You might find that your code runs in your computer but it you get errors on Gradescope. Often the problem is not Gradescope, but your code.

Here’s some of these common problems and how to solve them:

Mismatch in file name

ModuleNotFoundError: No module named 'misspeled file name'

Check the instructions and the error message for the right file name spelling. Remember that capitalization matters: Hello.py is different from hello.py

Mismatch in function name

Test Failed: name 'farenheit' is not defined

Check the instructions for the correct function name. In the example above, the autograder is trying to call fahrenheit() and the function was written without the h after a.

Mismatch in ouput (for strings)

Test Failed: 'Hello World\n' != 'Hello World!\n'
- Hello World
+ Hello World!
?            +

The first string is what was output by your code, the second is the expected output. This error message is indicating that the two strings are different (!=) and that the expected output has an extra character (the ! at the end of the string).

Function does not return anything

Test Failed: None != 'The output that was expected from the function!'

The None is the output from the function that was called – meaning, the function is probably not returning anything. Usually this means that instead of a return statement, the function uses a print statement. Make sure your function has a return statement.

Conversion function error

Test Failed: invalid literal for int() with base 10: '3.5'

The autograder is providing the string “3.5” as an argument, and your code is trying to convert “3.5” to an integer using int(). You should convert the argument to a float instead.

EOF error

EOF Error: EOF when reading a line

You are calling input() or a function that calls input() – remove all function calls outside functions. For example, if you are calling main(), delete it.

Infinite loop

Your submission timed out. It took longer than 600 seconds to run.

Your code has an infinite loop, so the autograder ran until it timed out. Make sure you are updating your index inside your while loop so that you eventually get out of that while loop.