0% found this document useful (0 votes)
120 views3 pages

Computer Science Exam Paper 2023-24

This document outlines the structure and instructions for a 1.5 hour computer science exam with a maximum of 30 marks. The paper is divided into 4 sections (A-D) containing multiple choice, short answer, and programming questions. Section A has 6 one-mark questions, Section B has 4 two-mark questions, Section C has 3 three-mark questions, and Section D has 3 four-mark questions testing a variety of Python concepts like lists, dictionaries, functions, loops, and string manipulation. Students are instructed to use Python to answer programming questions and show work for other questions.

Uploaded by

ajay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views3 pages

Computer Science Exam Paper 2023-24

This document outlines the structure and instructions for a 1.5 hour computer science exam with a maximum of 30 marks. The paper is divided into 4 sections (A-D) containing multiple choice, short answer, and programming questions. Section A has 6 one-mark questions, Section B has 4 two-mark questions, Section C has 3 three-mark questions, and Section D has 3 four-mark questions testing a variety of Python concepts like lists, dictionaries, functions, loops, and string manipulation. Students are instructed to use Python to answer programming questions and show work for other questions.

Uploaded by

ajay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

TIME : 1.5HRS SUBJECT:COMPUTER SCIENCE MAX.

MARKS: 30

GENERAL INSTRUCTIONS

1.The paper is divided into 4 sections A, B and C,D.


2. All questions are compulsory. All programming questions are to be answered using Python Language only.
3. Section A, consists of 6 questions(1-5). Each question carries 1 mark.
4. Section B, consists of 4 questions(6-9). Each question carries 2 marks.
5. Section C, consists of 3 questions(10-12). Each question carries 3 marks.
6. Section D, consists of 3 questions(13-14). Each question carries 4 marks.
7. Write down the correct option completely for MCQs.
Q.no SECTION-A Marks
1. Which among the following is not true? 1
a)The sort() function doesn’t make changes in the original sequence
b)The sorted() method doesn’t affect the original sequence
c)The sort() function returns nothing
d)The sorted() function always returns a sorted list
2. Given the following list MyList=[[12,14,16],[18,20,11],[22,24,15,19],[31,42,35,52]].Which 1
among the following slicing will produce the output [24,15,19]?
a)MyList[1:] b)MyList[1:3]
c)MyList[2][1:] d)MyList[2][:-1]
3. What will be the output of the following code: 1
T1=tuple({1:”A”,2:”B”})
print(T1)
a)(1,”A”,2,”B”) b)(1,2)
c)(“A”,”B”) d)((1,”A”),(2,”B”))
4. What will the following expression evaluate to: 1
c=43+13-9//3**2*7
print(c)
a)56 b)49
c)-7 d)Error
5. Choose the most appropriate option for the Assertion(A) and Reasoning (R): 1
Assertion(A):Python does not allow the use of multiple return statements for returning
multiple values to the caller.
Reason(R):No statement in the function will be excecuted after the return statement.The
return statement in python is the last statement of the function body which can be referred

EXAM 2023-24 Page 1


to as the Function Terminator.
a)Both A and R are true and R is the correct explanation of A.
b)Both A and R are true but R is NOT the correct explanation of A.
c)A is true but R is false.
d)A is false but R is true.
 e)Both A and R are false
SECTION-B
6. Find the output for the following code: 2
st="CBSE-Sample-paper-2023"
lis=st.split("-",maxsplit=2)
lis.insert(2,"CS")
print(*lis)

7. a)Predict the output of: 2


T=(1,2,’A’,’B’)
w,x,y,z=T
print(w,”-“,x,”-“,y,”-“,z)
b)What is the datatype of T?Is it mutable or immutable?

8. Consider the following function: 2


invaders="Big Names"
pos=200
level=1
def play():
max_level=level+18
print(len(invaders))
return max_level
res=play()
print(res)

Determine the Global name,Local names and builtin names from the above code.

9. Define namespace,scope and lifetime in python context.Explain LEGB rule. 2


SECTION-C
10. Write short notes on the Structural components of a Python Function. 3

11. Nandan has created the following dictionary.Find the output for statement 1,2 and 3: 3
D={"011":"Delhi","022":"mumbai","033":"Kolkata","044":"kochi","055":"Chennai"}
D1={}
print(D.keys()) #Statement1
for i in D.items():
if(i[1].istitle()==False):
D1[i[0]]=i[1].upper()
print(D1) #Statement2
D.update(D1)
print(D) #Statement3

EXAM 2023-24 Page 2


12. Convert the for loop into while loop: 3
print("Convert loop:")
for i in range(9,-2,-2):
c=0
print("c=",c+i)
SECTION-D

13. Predict output of Statement 1 and 2 for the following program: 4


list1=[]
list2=[2,4,6,8,10,12]
print(len(list2))
for i in range(len(list2)):
a=list2.pop()
list1.append(a)
print(list1) #Statement1
for j in range(len(list1)):
if(j%2!=0):
b=list1.pop(j)+1
list1.insert(j,b)
print(list1) #Statement2

14. Predict the output for the following code: 4


nm="Computer*123*456*Science"
s=nm.split("*")
print(sorted(s)) #Statement1
c=0
for j in s:
if j.isdigit():
c=c+int(j)
print(c) #Statement2
t=nm.partition("*")
fin=t[2]
ch=1
lens=0
while(ch==1):
for x in fin:
if x.isdigit() or x=="*":
lens+=1
else:
ch=0
break;
s1=t[0]+fin[lens:] #Statement3
print("#".join(s1)) #Statement4

--------END OF PAPER-------

EXAM 2023-24 Page 3

You might also like