Quiz Submission Practice

You are not logged in.

Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.

To alleviate strain on the course server during quizzes, we will no longer automatically run your submissions through test cases. Instead, we will provide an empty "test case" where you may view the print() output of any code you submit. Thus, you may debug by manually including or editing the examples given with the problem.

Below is a sample question (not representive of actual quiz content) on which you may practice this new submission format. For example, try to:

  • Submit incorrect code and see how errors display.
  • Add calls to print() and see what output appears.

Due to limitations of the website, you will still see a "score", either 0% or 100%, but this has no meaning; please ignore it. You will also still see "Test 01" in the test results, but this is not an actual test case. We will manually grade your submission afterward.

To preserve server responsiveness, we are limiting each coding question to well under 1 second of runtime per submission and at most 25 submissions. This is to encourage deliberate debugging and to help mitigate the end-of-quiz rush of repeated submissions.

Lastly, in the (hopefully unlikely event) the queue grows long again, rest assured that once you click Submit, your code is saved if the quiz page had fully loaded. To verify, always refresh the page and check that your code is still there.

Question N. [M points] Implement the function that meets the specification below. Include your entire function definition: header and body.

def count_digits(input):
    """Return the number of numeric characters in the str input."""

# For example:
print(count_digits("abc123"))  # prints 3
print(count_digits("3 trees for 4 forts, then 10 tins"))  # prints 4