





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
for CBSE board class 12 computer science subject 2024-25 sample paper python important questions
Typology: Exams
1 / 9
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-C ( 3 x 3 = 9 Marks) Marks
Predict the output of the following code: line=[4,9,12,6,20] for I in line: for j in range(1,I%5): print(j,’#’,end=””) print()
print (sum/float(count)) break OR a) Find the output of the following: def main ( ) : Moves=[11, 22, 33, 44] Queen=Moves Moves[2]+= L=len(Moves) For i in range (L): print (“Now@”, Queen[L-i-1], “#”, Moves [i]) main()
Now@ 44 # 11 Now@ 55 # 22 Now@ 22 # 55 Now@ 11 # 44 b) What will the result given by the following? (a) type (6 + 3) <class 'int'> (b) print (6 / 3) 2. (c) print (6 // 3) 2 (d) print (6 % 3) 0
def callon(b=20, a=10): b = b + a a = b - a print(b, "#", a) return b x = 100 y = 200 x = callon(x, y) print(x, "@", y) y = callon(y) print(x, "@", y)
print(d) sum= for i in d: sum+=d[i] print(sum) print("sum of values of dictionaries",sum)
{'Rohan': 67, 'Ahasham': 78, 'naman': 89, 'pranav': 79} 67 145 234 313 sum of values of dictionaries 313 B) Write the output displayed on execution of the following python code: LS=["HIMALAYA", "NILGIRI", "ALASKA", "ALPS"] D={} for S in LS : if len(S) %4 == 0: D[S] = len(S) for K in D: print (K,D[K], (sep = "#")
A) What is the output of the following code? try: x = 10 / 0 except ZeroDivisionError: print("Division by zero") finally: print("Finally block")
Division by zero Finally block B) What is the output of the following code? try: raise Exception("An error occurred") except Exception as e: print(e) finally: print("Finally block")
An error occurred Finally block
Q No. SECTION E (2 X 5 = 10 Marks) Marks