Last Updated: 10 Oct, 2025

Student Branch Filter

Easy
Asked in company
HCL Technologies

Problem statement

You are given a list of college students. Each student is represented by a set of attributes: a unique integer ID, a string name, and a string branch.


Your task is to write a program that filters this list and creates a new, separate list containing only the students whose branch is exactly "Mechanical".


The students in the returned list should maintain their relative order from the original list.


Input Format:
The first line contains a single integer N, the total number of students.

The next N lines each contain the details of one student in a comma-separated format: ID,Name,Branch.


Output Format:
For each student in the filtered "Mechanical" list, print their details on a new line in the format: ID: [id], Name: [name], Branch: [branch].

If no students are found in the "Mechanical" branch, print a single line: No students found in the Mechanical branch.


Note:
The branch name matching is case-sensitive. For example, "mechanical" would not be considered a match for "Mechanical".