Test Index

CBSE Class 12 Computer Science 2023 Paper Compartment Get it on Google PlayDownload on the App Store

© examsnet.com
Question : 33 of 35
Marks: +1, -0
(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.
OR
(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 ₹ 1000.
Advertisements
Go to Question: