LearnPy Hub
← Pandas: DataFrames problems
Medium

apply() a Function

Give each student a class: First if cgpa ≥ 3.75, Second if ≥ 3.25, else Third, using apply. Print name class lines.

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 First
Rafi Second
Sara First
Tuhin Second
Nadia Second

Sample 2

Input
A CSE 3.00 100
END
Output
A Third
solution.py
Output appears here
apply() a Function · Python practice problem · LearnPy Hub