



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
CBSE class 12 sample paper for computer science 2024-25
Typology: Exams
1 / 6
This page cannot be seen from the preview
Don't miss anything!




General Instructions: This question paper contains 37 questions. All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one of the choices in such questions The paper is divided into 5 Sections- A, B, C, D and E. Section A consists of 21 questions (1 to 21). Each question carries 1 Mark. Section B consists of 7 questions (22 to 28). Each question carries 2 Marks. Section C consists of 3 questions (29 to 31). Each question carries 3 Marks. Section D consists of 4 questions (32 to 35). Each question carries 4 Marks. Section E consists of 2 questions (36 to 37). Each question carries 5 Marks. All programming questions are to be answered using Python Language only. In case of MCQ, text of the correct answer should also be written. SECTION – A Q No. Section-A (21 x 1 = 21 Marks) Marks
should be: (A) fobj.read(2) (B) fobj.read() (C) fobj.readline() (D) fobj.readlines()
Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the correct choice as: (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
Q No. Section-B (7 x 2 = 14 Marks) Marks
b) Write the output of following code: lst1=[10,15,20,25,30] lst1.insert(3,4) lst1.insert(2,3) print(lis[-5])
What is the difference between Local Variable and Global Variable? 2
Q No. Section-C ( 3 x 3 = 9 Marks) Marks
Q No. SECTION D (4 X 4 = 16 Marks) Marks
(i) 15 122 84 2500 (ii) 21 120 76 1500 (iii) 105 107 105 1800 (iv) 110 105 105 1900
b) Predict the output of the following code. def swap(P ,Q): P,Q=Q,P print( P,"#",Q) return (P) R= S= R=swap(R,S) print(R,"#",S)
b) Write a function in Python, Push(SItem) where , SItem is a dictionary containing the details of stationary items– {Sname:price}. The function should push the names of those items in the stack who have price greater than 75. Also display the count of elements pushed into the stack. For example: If the dictionary contains the following data: Ditem={"Pen":106,"Pencil":59,"Notebook":80,"Eraser":25}
The stack should contain: Notebook Pen The output should be: The count of elements in the stack is 2
Anshuman is a Python learner, who has assigned a task to write python Codes to perform the following operations on binary files. Help him in writing codes to perform following tasks (b) & (c): (b) Write a statement to open a binary file named SCHOOL.DAT in read mode. The file SCHOOL.DAT is placed in D: drive. (c) Consider a binary file “employee.dat” containing details such as empno:ename:salary (separator ':'). Write a python function to display details of those employees who are earning between 20000 and 30000 (both values inclusive).
data
file