Check Collection Length Is N
Validates that a student’s collection (list, tuple, set, etc.) has exactly N elements, optionally enforcing a specific type.
| Device Type |
|---|
| Jupyter |
Variables:
| Variable Name | Variable Description | Type | Required? | Default |
|---|---|---|---|---|
student_collection_variable_name | The name of the student’s collection variable. | str | Yes | |
n | The exact number of elements expected. | int | Yes | |
collection_type | Optional: A Python type to enforce (e.g. 'list', 'tuple'). If not provided, only the length is checked. | str | No |