Class 12 Computer Science
Homework Assignment (2026-27)
Section A: Very Short Answer
1. What is data handling in Python?
2. Name any two file modes used in Python.
3. What is the purpose of a function in Python?
4. Name any two built-in functions in Python.
Section B: Short Answer
5. What is the difference between text file and binary file?
6. Write a program to read a file and display its contents.
7. Write a function to find the sum of all even numbers between 1 and n.
8. Explain default arguments with a suitable example.
Section C: Long Answer
9. Write a Python program to:
o Create a text file
o Write data into it
o Read and display the contents
10. Write a Python program using functions to:
• Input a number
• Check whether it is an Palindrome number
Section D: Case Study Based
11. A company stores employee details in a file. Write a program to:
• Add new employee records
• Display all records from the file
Section E: Application Based
12. A school is developing a system to calculate student grades. Write functions to:
• Accept marks of 5 subjects
• Calculate total and percentage
• Display grade based on percentage:
o ≥ 90 → A
o ≥ 75 → B
o ≥ 50 → C
o < 50 → Fail
NOTE- ALL WORK SHOULD BE WRITTEN IN
YOUR NOTEBOOK