LearnPy Hub
← Pandas: DataFrames problems
Medium

Status Column With loc

Add a column status that is graduating when credits are at least 120 and continuing otherwise, using df.loc[condition, 'status'] = …. Print each name status, then the count of graduating students.

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 graduating
Rafi continuing
Sara graduating
Tuhin continuing
Nadia graduating
3

Sample 2

Input
A CSE 3.00 100
END
Output
A continuing
0
solution.py
Output appears here
Status Column With loc · Python practice problem · LearnPy Hub