LearnPy Hub
← Pandas: DataFrames problems
Easy

Students per Department

Print each department and its number of students, sorted by department name, as DEPT N.

Input

Lines 'name dept cgpa credits', then END.

Output

Lines.

Sample 1

Input
Mim CSE 3.82 120
Rafi EEE 3.41 98
Sara CSE 3.95 132
Tuhin BBA 3.60 110
Nadia CSE 3.71 125
END
Output
BBA 1
CSE 3
EEE 1

Sample 2

Input
A CSE 3.00 100
END
Output
CSE 1
solution.py
Output appears here
Students per Department · Python practice problem · LearnPy Hub