Python Programming Unit 4 – File Operations & Regular Expressions: AKTU previous year questions
8 AKTU questions from Unit 4 (File Operations & Regular Expressions) asked in 2026, tagged by marks, year and topic. In short: about 19 marks of every paper come from this unit; the most asked topic is File Reading (11 times); 2 questions came back in a later year. The latest ones are listed below; on the page you can filter them by 2-mark or long questions, topic and repeats.
Unit 4 previous year questions
- What is a file pointer in Python? (2 marks, 2026, File Pointer Manipulation)
- What are read() and readline() functions in file handling? (2 marks, 2026, File Reading)
- What is the purpose of the seek() method in file handling? Demonstrate a program that copies content from one file to another. (7 marks, 2026, File Pointer Manipulation)
- Describe file writing functions: write(), writelines(). Write a program to write student records to a file. (7 marks, 2026, File Writing)
- Explain manipulating file pointer using seek(). Write a program to read last n lines from a file. (7 marks, 2026, File Pointer Manipulation)
- What are file operations in Python? Explain the different modes used while opening a file. (7 marks, 2026, File Reading)
- Describe regular expressions using re module. Write a program to find all digits in a string. (7 marks, 2026, Regular Expressions)
- Write a Python program to create a file and write multiple lines into it. (7 marks, 2026, File Writing)
Most asked Unit 4 topics
- File Reading – asked 11 times
- File Writing – asked 9 times
- Exceptions & Error Handling – asked 8 times
Unit 4 question pattern
- 2-mark questions: 2 asked in 2026
- 7-mark questions: 6 asked in 2026
- About 19 marks from Unit 4 in every paper
- 2 questions were asked again in a later year
Unit 4 questions year by year
- 2026: 8 Unit 4 questions asked (46 marks across that year's papers)