expected_answer
expected_answer
Build an expected_answer dict for a gather question’s expected_answer
argument in add_gather_question(). It takes the
same arguments, and applies the same checks, as
Step.set_expected_answer().
Parameters
digits
The exact number of digits, from 1 to 64. Can’t be combined with
min_digits or max_digits.
min_digits
Keyword-only. The fewest digits, from 1 to 64. Requires max_digits.
max_digits
Keyword-only. The most digits, from 1 to 64, and at least min_digits.
Requires min_digits.
Returns
dict[str, int] — {"digits": N} or {"min_digits": a, "max_digits": b}.
Raises
ValueError for a count outside 1 to 64, a min_digits greater than
max_digits, digits combined with a range, or a range with only one end.