LearnPy Hub
← Pandas: DataFrames problems
Hard

Rank Students

Add a column rank = rank by cgpa, highest = 1, ties share the lowest rank (method='min'). Print name rank lines in the original order.

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
Mim 2
Rafi 5
Sara 1
Tuhin 4
Nadia 3

Sample 2

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