Python Test
Question 1:-
1) Add New Student:
- Input: Roll Number (unique), Name, Class.
- Record the Date of Admission
2) Add Marks:
Input marks for multiple subjects(min 4) for an existing student.
Store marks under the corresponding roll number.
3) View Student Details:
- Display:
- Roll Number, Name, Class, Date of Admission, Marks in all
subjects.
4) Calculate and Display Result:
- Show a tabular report with:
Roll Number, Name, Total Marks, Percentage, Grade.
Grade Criteria:
A: ≥ 90%
B: ≥ 75%
C: ≥ 50%
D: < 50%
5) Exit:
Exit the application.
Question 2 :-
This is the given dictionary :-
data = [ {'company': 'Tech Innovators Ltd', 'dept': 'IT', 'employee':
'Alex Johnson', 'salary': 50000}, {'company': 'Tech Innovators Ltd',
'dept': 'ACC', 'employee': 'Brian Lee', 'salary': 25000}, {'company':
'Global Solutions Inc', 'dept': 'IT', 'employee': 'Chris Wang', 'salary':
35000}, {'company': 'Tech Innovators Ltd', 'dept': 'IT', 'employee':
'Diana Smith', 'salary': 60000}, {'company': 'Tech Innovators Ltd',
'dept': 'IT', 'employee': 'Emily Davis', 'salary': 60500}, {'company':
'Global Solutions Inc', 'dept': 'ACC', 'employee': 'Franklin Moore',
'salary': 80000} ]
Organize the data into a nested dictionary format by:
● Grouping by Company and then by Department.
● Under each department, list employees with their name
and salary.
Eg-
{ 'Company_Name':
{ 'Department_Name': [ {
'employee': 'Employee_Name',
'salary': Salary_Amount} ]}
}
Question 3:-
Write a Python program that takes a date as input in the format
YYYY-MM-DD and checks if it falls on a weekend (Saturday or Sunday).
Eg:
Input: 2025-03-01
Output: Weekend