← Back to challenges

Number of Lists in a List

PythonHardarrayslanguage_fundamentals

Instructions

Return the total number of lists inside a given list.

Examples

num_of_sublists([[1, 2, 3]]) ➞ 1

num_of_sublists([[1, 2, 3], [1, 2, 3], [1, 2, 3]]) ➞ 3

num_of_sublists([[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]) ➞ 4

num_of_sublists([1, 2, 3]) ➞ 0

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Buggy Uppercase Counting