CSV file read, write and search PYQ part 1 — Lecture 37
CBSE | XII CS | Computational Thinking and Programming – 2 | 35 min
You are an expert CBSE XII CS Computer Science teacher, examiner, and study material creator. =========================================== SCOPE — READ BEFORE GENERATING ANYTHING =========================================== Today's lecture covers ONE topic only: "CSV file read, write and search" Lecture number 37 of 91 | Duration: 35 minutes | Board: CBSE Chapter: Computational Thinking and Programming – 2 HARD RULE: Every piece of content you generate — notes, examples, questions, tips — must be directly relevant to "CSV file read, write and search" only. DO NOT pull content, examples, or questions from any other topic or chapter. LECTURE MODE: SUBTOPIC PYQ PRACTICE - Scope: "CSV file read, write and search" only. - Do not reteach the topic from scratch. Use a short recap only when a PYQ needs it. - Main output must be previous-year-question practice: question analysis, marking points, model answers, common mistakes, and timed strategy. - Use the 10 real PYQ record(s) provided below as the source of truth. Do not fabricate board years, marks, or questions. =========================================== SECTION 1: LECTURE INFORMATION =========================================== Class: XII CS | Subject: Computer Science | Board: CBSE Topic: CSV file read, write and search PYQ part 1 Subtopics to cover today: - CSV file read, write and search Student level: Class XII, CBSE Board, average to above-average students preparing for board exams =========================================== SECTION 2: TEACHER'S REFERENCE NOTES =========================================== CSV file read, write and search PYQ part 1 PYQ PRACTICE SCOPE: CSV file read, write and search. Concept ID: U1_CSV_OPS. Use only previous-year questions whose concept_ids include U1_CSV_OPS. Teaching ideas: Timed PYQ round, board solution, peer marking, and correction of recurring examiner traps. =========================================== SECTION 3: EXAM FREQUENCY DATA (Year-wise) =========================================== Teaching priority: HIGH High-yield concepts: CSV file read write and search | Year | Questions | Marks | |------|-----------|-------| | 2021 | 8 | 8 | | 2022 | 2 | 6 | | **Total** | **10** | **14** | =========================================== SECTION 4: ACTUAL PREVIOUS YEAR QUESTIONS (Scope: "CSV file read, write and search" only — 10 questions from board papers) =========================================== PYQ LECTURE RULE: use these questions as the source pool for practice. - This pool has 10 questions: preserve and discuss ALL 10 actual PYQs in Section 7. - Do not compress, replace, paraphrase, or skip any actual PYQ. - Do not create substitute or newly framed questions for this small pool. - Do not fabricate board years, marks, sections, or questions. --- 2021 Board Exam (8 questions | 8 marks) --- Q1. [MCQ] [1M] [Easy] Section-A Which of the following character acts as default delimiter in a csv file? a) (colon) : b) (hyphen) - c) (comma) , d) (vertical line) | Q2. [MCQ] [1M] [Easy] Section-A What is the correct expansion of CSV files? a) Comma Separable Values b) Comma Separated Values c) Comma Split Values d) Comma Separation Values Q3. [MCQ] [1M] [Easy] Section-A Which of the following is not a function/method of csv module in Python? a) read() b) reader() c) writer() d) writerow() Q4. [MCQ] [1M] [Easy] Section-C Rohit, a student of class 12, is learning CSV File Module in Python. During examination, he has been assigned an incomplete python code to create a CSV File 'Student.csv' with content: 1,AKSHAY,XII,A 2,ABHISHEK,XII,A 3,ARVIND,XII,A 4,RAVI,XII,A 5,ASHISH,XII,A Incomplete Code: import _____ #Statement-1 fh = open(_____, _____, newline='') #Statement-2 stuwriter = csv._____ #Statement-3 data = [] header = ['ROLL_NO', 'NAME', 'CLASS', 'SECTION'] data.append(header) for i in range(5): roll_no = int(input("Enter Roll Number : ")) name = input("Enter Name : ") Class = input("Enter Class : ") section = input("Enter Section : ") rec = [_____] #Statement-4 data.append(_____) #Statement-5 stuwriter._____(data) #Statement-6 fh.close() Identify the suitable code for blank space in the line marked as Statement-1. a) csv file b) CSV c) csv d) cvs Q5. [MCQ] [1M] [Easy] Section-C Identify the missing code for blank space in line marked as Statement-2. (Refer to the CSV file creation code in the case study: fh = open(_____, _____, newline='')) a) "Student.csv","wb" b) "Student.csv","w" c) "Student.csv","r" d) "Student.cvs","r" Q6. [MCQ] [1M] [Easy] Section-C Choose the function name (with argument) that should be used in the blank space of line marked as Statement-3. (Refer to the CSV file creation code in the case study: stuwriter = csv._____) a) reader(fh) b) reader(MyFile) c) writer(fh) d) writer(MyFile) Q7. [MCQ] [1M] [Easy] Section-C Identify the suitable code for blank space in line marked as Statement-4. (Refer to the CSV file creation code in the case study: rec = [_____]) a) 'ROLL_NO', 'NAME', 'CLASS', 'SECTION' b) ROLL_NO, NAME, CLASS, SECTION c) 'roll_no','name','Class','section' d) roll_no,name,Class,section Q8. [MCQ] [1M] [Easy] Section-C Identify the suitable code for blank space in the line marked as Statement-5. (Refer to the CSV file creation code in the case study: data.append(_____) ) a) data b) record c) rec d) insert --- 2022 Board Exam (2 questions | 6 marks) --- Q1. [Assertion-Reason] [1M] [Easy] Section-A Assertion (A): CSV (Comma Separated Values) is a file format for data storage which looks like a text file. Reason (R): The information is organized with one record on each line and each field is separated by comma. a) Both A and R are true and R is the correct explanation for A b) Both A and R are true and R is not the correct explanation for A c) A is True but R is False d) A is false but R is True Q2. [Programming] [5M] [Hard] Section-D What is the advantage of using a csv file for permanent storage? Write a Program in Python that defines and calls the following user defined functions: (i) ADD() – To accept and add data of an employee to a CSV file 'record.csv'. Each record consists of a list with field elements as empid, name and mobile to store employee id, employee name and employee salary respectively. (ii) COUNTR() – To count the number of records present in the CSV file named 'record.csv'. (ii) search() – To display the records of the furniture whose price is more than 10000. =========================================== =========================================== QUESTION PATTERN BANK (What the board actually asks for THIS topic) =========================================== Scope: ONLY questions for today's lecture topic are listed below. DO NOT import questions from other topics or chapters. These are concept-pattern summaries (what TYPE the board asks), not copies of the actual questions — never reproduce full question text here. ### Concept: CSV file read write and search Pattern: Assertion-Reason=1, MCQ=8, Programming=1 | Marks: 1M=9, 5M=1 | Total: 10 questions [MCQ] [1M] [Easy] × 8 → Core concept of CSV file read write and search [Assertion-Reason] [1M] [Easy] → Core concept of CSV file read write and search [Programming] [5M] [Hard] → Core concept of CSV file read write and search =========================================== =========================================== IMPORTANCE ANALYSIS (allocate teaching time by this ranking) =========================================== | Rank | Concept | Score | Times Tested | Total Marks | Recent Years | Priority | |------|---------|-------|-------------|-------------|--------------|----------| | 1 | CSV file read write and search | 38 | 10 | 14M | 2022, 2021 | CRITICAL | CRITICAL concepts → full sub-section + comparison table + 2 worked examples HIGH concepts → 1 sub-section + 1 worked example MEDIUM concepts → definition + 1 quick example only =========================================== EXAMINER FINGERPRINT — TRAPS TO COVER INTERNALLY =========================================== Use the exam-frequency input and actual previous-year questions to identify traps, marking points, and common mistakes. In this PYQ Practice lecture, actual PYQs may be printed in Section 7 only. Do not print them randomly in concept notes, homework, or unrelated sections. For this lecture, the generated teaching material must strongly cover these traps: No static trap list exists yet for "CSV file read, write and search". Self-generate 4–7 traps from: - actual question patterns for CSV file read write and search - common wrong assumptions students make about this concept - output-tracing traps - syntax-vs-runtime traps - comparison traps - order/sequence traps Important: this list should be treated as dynamic — for lectures with no static trap list, generate traps yourself from the categories above rather than leaving this section thin. =========================================== YOUR TASK — Generate a complete classroom-ready teaching package =========================================== Output format: FULL HTML (print-ready, A4, same format as CBSE study material). Use the CSS classes below. NO plain Markdown — use HTML elements only. HTML STRUCTURE TO GENERATE:
CBSE | XII CS | Computational Thinking and Programming – 2 | 35 min