Skip to main content

Check Collection Is Not Empty

Validates that a student’s collection has at least 1 element, optionally enforcing a specific collection type.

Device Type
Jupyter

Variables:

Variable NameVariable DescriptionTypeRequired?Default
student_collection_variable_nameThe name of the student’s collection variable (list, tuple, etc.).strYes
collection_typeOptional: a Python type to enforce (e.g. 'list'). If omitted, no type check is performed.strNo

Examples: