You are viewing this question as it will appear in the manual grading interface. Return to the normal view when you are done.

Autograder demo: Randomized function name

This is a small example question that shows how we can randomize questions using the Python autograder. server.py randomizes a function name and a list of input/output pairs the function must correctly handle, plus a default output for every other case. The test file checks these pairs and the default output.

Design a function named foo that takes a string as input and produces a string as output. For each of the input strings listed in the following table, it should produce the corresponding output:

Input Output
"parrot""hamster"
"spam""ministry"
"quest""herring"
"duck""knight"
For any other input, it should produce "grail".
user_code.py

Correct answer

Student view placeholder

In student views this area is used for assessment and score info.
Tools

Staff information

Question

Title:
Autograder demo: Randomized function name

Variant

Started at:
2026-09-19 09:09:32 (CDT)
Duration:
0s
Show/Hide answer
{}
History
dec frac
rad deg