LearnPy Hub
← Pandas: DataFrames problems
Easy

First and Last Rows

Print the names in df.head(2) on one line, then the names in df.tail(2) on the next.

Input

Lines 'name dept cgpa credits', then END.

Output

Two 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 Rafi
Tuhin Nadia

Sample 2

Input
A CSE 3.00 100
END
Output
A
A
solution.py
Output appears here
First and Last Rows · Python practice problem · LearnPy Hub