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 quux 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
"spam""knight"
"silly""hamster"
"parrot""duck"
"quest""herring"
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:11:34 (CDT)
Duration:
0s
Show/Hide answer
{}
History
dec frac
rad deg