AI Prompt Builder

Generate a copy-paste ready prompt for ChatGPT, Claude, Gemini, or DeepSeek
Study Notes Prompt PPT Slides Prompt
Configure Prompt
Describe class, board, and ability level
Selected Lecture
Lecture #25
File basics, paths, modes, seek and tell PYQ part 2
File basics, paths, modes, seek and tell
PYQ reference preview 12 included 1 excluded

Review every matched question before generating. Flag a wrongly categorised question to quarantine it from both study and PPT prompts until it is corrected in CBSE Paper Analyzer.

Included in reference ID 6490 · 2021 · 1 mark(s)
Syntax for opening Student.csv file in write mode is myfile = open("Student.csv","w",newline=''). What is the importance of newline=''? a) A newline gets added to the file b) Empty string gets appended to the first line. c) Empty string gets appended to all lines. d) EOL translation is suppressed
File Handling → File basics paths modes seek and tell, CSV file read write and search · Concept U1_FILE_BASICS_MODES;U1_CSV_OPS
Included in reference ID 6495 · 2021 · 1 mark(s)
Which of the following statement opens a binary file record.bin in write mode and writes data from a list lst1 = [1,2,3,4] on the binary file? a) with open('record.bin','wb') as myfile: pickle.dump(lst1,myfile) b) with open('record.bin','wb') as myfile: pickle.dump(myfile,lst1) c) with open('record.bin','wb+') as myfile: pickle.dump(myfile,lst1) d) with open('record.bin','ab') as myfile: pickle.dump(myfile,lst1)
File Handling → File basics paths modes seek and tell, Binary file operations with pickle · Concept U1_FILE_BASICS_MODES;U1_BINARY_PICKLE_OPS
Excluded — review required ID 6321 · 2023 · 5 mark(s)
(a) Write a point of difference between append (a) and write (w) modes in a text file. Write a program in Python that defines and calls the following user defined functions : (i) Add_Teacher() : It accepts the values from the user and inserts record of a teacher to a csv file "Teacher.csv". Each record consists of a list with field elements as T_id, Tname and desig to store teacher ID, teacher name and designation respectively. (ii) Search_Teacher() : To display the records of all the PGT (designation) teachers. (ii) Count_Device() : To count and display number of peripheral devices, whose price is less than or equal to 1000.
File Handling → CSV file read write and search · Concept U1_FILE_BASICS_MODES;U1_CSV_OPS;U1_TEXT_FILE_OPERATIONS
Included in reference ID 6322 · 2023 · 5 mark(s)
(b) Write one point of difference between seek() and tell() functions in file handling. Write a program in Python that defines and calls the following user defined functions : (i) Add_Device() : The function accepts and adds records of the peripheral devices to a csv file 'peripheral.csv'. Each record consists of a list with field elements as P_id, P_name and Price to store peripheral device ID, device name, and price respectively. (ii) Count_Device() : To count and display number of peripheral devices, whose price is less than or equal to 1000.
File Handling → File basics paths modes seek and tell, CSV file read write and search · Concept U1_FILE_BASICS_MODES;U1_CSV_OPS
Included in reference ID 6607 · 2023 · 5 mark(s)
(i) Differentiate between r+ and w+ file modes in Python. (ii) Consider a file, SPORT.DAT, containing records of the following structure: [SportName, TeamName, No_Players] Write a function, copyData(), that reads contents from the file SPORT.DAT and copies the records with Sport name as "Basket Ball" to the file named BASKET.DAT. The function should return the total number of records copied to the file BASKET.DAT. (ii) A Binary file, CINEMA.DAT has the following structure: {MNO:[MNAME, MTYPE]} Where MNO – Movie Number, MNAME – Movie Name, MTYPE is Movie Type. Write a user defined function, findType(mtype), that accepts mtype as parameter and displays all the records from the binary file CINEMA.DAT, that have the value of Movie Type as mtype.
File Handling → File basics paths modes seek and tell, Binary file operations with pickle · Concept U1_FILE_BASICS_MODES;U1_BINARY_PICKLE_OPS
Included in reference ID 6143 · 2024 · 1 mark(s)
Which of the following file opening mode is used to open a file in append and read mode ? (A) r+ (B) w+ (C) a+ (D) x+
File Handling → File basics paths modes seek and tell, Text file reading writing searching and counting · Concept U1_FILE_BASICS_MODES;U1_TEXT_FILE_OPERATIONS
Included in reference ID 6161 · 2024 · 3 mark(s)
Write the user defined function Modify() to read a text file "data.txt" and replace all the occurrences of "COmputer" with "Computer" and display all the lines on screen.
File Handling → File basics paths modes seek and tell · Concept U1_FILE_BASICS_MODES
Included in reference ID 6365 · 2024 · 5 mark(s)
(a) (i) What is the main purpose of seek() and tell() method ? (ii) Consider a binary file, Cinema.dat containing information in the following structure : [Mno, Mname, Mtype] Write a function, search_copy(), that reads the content from the file Cinema.dat and copies all the details of the "Comedy" movie type to file named movie.dat. (ii) A Binary file, "Items.dat" has the following structure : [Icode, Description, Price] Where Icode – Item code Description – Detail of item Price – Price of item Write a function Add_data(), that takes Icode, Description and Price from the user and writes the information in the binary file "Items.dat".
File Handling → File basics paths modes seek and tell, Binary file operations with pickle · Concept U1_FILE_BASICS_MODES;U1_BINARY_PICKLE_OPS
Included in reference ID 6192 · 2025 · 1 mark(s)
Assertion (A): For a binary file opened using 'rb' mode, the pickle.dump() method will display an error. Reason (R): The pickle.dump() method is used to read from a binary file. (A) Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation for Assertion (A). (B) Both Assertion (A) and Reason (R) are true and Reason (R) is not the correct explanation for Assertion (A). (C) Assertion (A) is true but Reason (R) is false. (D) Assertion (A) is false but Reason (R) is true.
File Handling → File basics paths modes seek and tell, Binary file operations with pickle · Concept U1_FILE_BASICS_MODES;U1_BINARY_PICKLE_OPS
Included in reference ID 6405 · 2025 · 3 mark(s)
(a) Write a Python function that displays all the lines ending with a dot (.) from a text file, "Colors.txt". For example, if the file "Colors.txt" contains : White is a mix of seven colors. What are these seven colors ? VIBGYOR – violet, indigo, blue, green, orange and red. When we mix all these colors we just get one light which is the WHITE light. Then the output should be : White is a mix of seven colors. VIBGYOR – violet, indigo, blue, green, orange and red. which is the WHITE light. (Hint : You will have to ignore trailing white spaces to check the last character)
File Handling → File basics paths modes seek and tell · Concept U1_FILE_BASICS_MODES
Included in reference ID 6694 · 2025 · 3 mark(s)
A. Write a Python function that displays the number of times the word "Python" appears in a text file named "Prog.txt".
File Handling → Text file reading writing searching and counting · Concept U1_FILE_BASICS_MODES;U1_TEXT_FILE_OPERATIONS
Included in reference ID 6217 · 2025 · 4 mark(s)
Write a program in Python to create a text file MARKS.TXT and write the names of all those students and their total marks obtained in Physics, Chemistry and Maths whose total marks are greater than 220.
File Handling → File basics paths modes seek and tell · Concept U1_FILE_BASICS_MODES
Included in reference ID 6227 · 2026 · 1 mark(s)
Consider the statement given below : f1 = open("pqr.dat","_______") Which of the following is the correct file mode to open the file in read only mode ? (A) a (B) rb (C) r+ (D) rb+
File Handling → File basics paths modes seek and tell, Binary file operations with pickle · Concept U1_FILE_BASICS_MODES;U1_BINARY_PICKLE_OPS
Select a lecture and generate your AI prompt

Pick a lecture from the panel on the left, configure the board and student level, then click Generate Prompt. The result includes PYQ data, frequency analysis, exam trends, and a full 15-section teaching package request — ready to paste into any AI assistant.

ChatGPT Claude Gemini DeepSeek
PYQ Analysis
Frequency, marks & high-yield concepts
Lecture Flow
Exact time-allocation plan
15 Sections
From objectives to ranked exam questions
Export
Copy or download as .txt