how to count sublist elements in python code example
Example: python count elements in sublists
def sumOfStudents(students):
count = sum( [ len(listElem) for listElem in students])
return count
sumOfStudents(students)
def sumOfStudents(students):
count = sum( [ len(listElem) for listElem in students])
return count
sumOfStudents(students)