0% found this document useful (0 votes)
8 views6 pages

Cs Annual Pyq

This document is an examination paper for Class XI Computer Science for the academic year 2023-2024, consisting of 28 questions divided into three sections with varying marks. Section A contains 12 questions worth 1 mark each, Section B has 10 questions worth 2 to 3 marks, and Section C includes 6 questions worth 4 marks each, all requiring answers in Python. The paper covers various topics in Python programming, including identifiers, data structures, functions, and error handling.

Uploaded by

abhinav22022022
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)
8 views6 pages

Cs Annual Pyq

This document is an examination paper for Class XI Computer Science for the academic year 2023-2024, consisting of 28 questions divided into three sections with varying marks. Section A contains 12 questions worth 1 mark each, Section B has 10 questions worth 2 to 3 marks, and Section C includes 6 questions worth 4 marks each, all requiring answers in Python. The paper covers various topics in Python programming, including identifiers, data structures, functions, and error handling.

Uploaded by

abhinav22022022
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/ 6

RollNo.:1 No.

of printed pages : 11
ANNUAL EXAMINATION 2023-2024
Time :3 hours ) [Max. Marks :60
Class - XI
Computer Science (083)
General Instructions:

Please check, this question paper contains 28 questions.


The paper is divided into 3 Sections - A,B and C.
Section A, consists of 12 questions (1 to 12). Each
question carries 1 mark.

Section B, consists of 10 questions (13 to 22).


Question nos. 13 to 18 (6 questions) carries 2 marks
each.

Question nos. 19 to 22 (4 questions) carries 3 marks


each.

Section C. consists of 6 questions (23 to 28). Each


question carries 4 mark.
All programming questions are to be answered using
Python Language only.

Section -A

1. Which of the following is/are a valid identifier in Python?

P.T.O.
Trusted EAspirants
(2 )
a) per%marks b) for (3 )
While
d) 5.
true Given the following
2. What is/are the correct way to add
dictionaries -
dict_student ("rno" :"53", "name":
an
of a list in Python? element to the end dict_marks =("Accts": 87, "English": 65)Rajveer Singh)
a) list.add(element) Which statement(s) will append the
in dict_student? contents of dict_marks
b) list.append(element) a)
c)
d)
list.insert(element,-1)
list.extend(elernent)
b) didictct_marstudentksS.updatdict_marks
+ e(dict_student)
) dict_ student.update(dict_marks)
d)
3. What will be theoutput of -
6.
dict_student.extend(dict_marks)
What will be the output of the
Str = "HappyNewYear" following code?
L= ['purple , orange', 'green',
'yllow']
print(Str[3:5),join([Str[7:10], Str(-1].upper) ]) print(len(L)/2*len(L0)
4. Which of the following staterment(s) would give an error 7. Which of the following operator cannot be used
with string
during the executionof the following code? data type?
a +
b) in
R= ('pno': 52, 'pname': "Virat', 'expert': c)
('Badrminton', Tennis'], 'score':(77, 44) d) /

print(R) #Staternent 1 8. Considera tuple tupl = (10, 15, 25,'and', 30). ldentify
R['expert'||0]='Cricket' #Statement 2 the statement that will result in an error.
R['score'|0]=50 #Staterment 3
P.T.O.
R[Virat']='Virat Kohli #Statenent 4
ste
(4)

print(tup 1[2) b) print(tup1/2)+2)1 (5 )


a) d) printlen(tup 1)
d print(min(tup1) 11, Evaluate the following arithmetic
expression
are ASSERTION
and
(15+7"10/5)//7*5+3**3%12
Question
based
No.
questions.
9 and
Mark
10
the correctchoice as
are true and Ris
the correct
REASONING 12. Evaluate the following logical
expression -
la) Both
for A.
A and R
texplanation
andRis not the correcttexplanation
not(76 %18 <4) and 13*5-65> 10 %8 or 94
==62
(6) Both Aand Rare true Section-B
for A. 13. What willbe the output of -
False.
c Ais True but Ris
(d Ais false but Ris True.
A=(1,2,3):14,5,6])
for B.in A:
C=B[2] A(B]
Assertion (A):A python function that D=C[0:3)
9.
parameters can be called without any parameters
accepts print(D)

Daaconing (R) :Functions carn carry delaut vaiues that 14.


are used, whenever values are not received
Differentiate between break and continue staternents with
from calling example,
function.

15. Explain explicit type conversion with


10. Assertion (A) : Python Standard Library consist example.
various modules. 16. Differentiate between actual and formal parameters with
Reasoning (R) : A function in a module is used to help of an example.
sirmplify the code and avoids repetition.
P.TO.
(6)

outcome(s) executed
(7)
17. What are
the possible
specilythe maximum and
Irom the (0) ES#NE#IO# (i) LENO#ON#
following code? Also
values that can be
assigned to variable NUM minimum (0) NSENLO# (iv) ECNB#1S#

importrandom 19. lderntify Errors in the following lines of codes (Underline


"RIGHT" "BACK")
NAV =LEFT", "FRONT", each correction)
NUM =random.randint(1,3)
defCallMela-10,b):
NAVG =
1,-1):
2 for x in range([10]) :
for Cin range(NUM, NAVIC] a-a+b
NAVG= NAVG + print(a,b)
print(NAVG,end='@')
(0) FRONTORIGHTO (61) No output X=20; 30=y
CallMe(x;y)
(ii) BACKØRIGHT@ (iv) RIGHTOBACKa
Callme(y,end=z)

12 What are the possible outcomels) executed irom the 20. What will be the output of the following code -
following code? Also specify the maximumand the x,y=15,10
minimum values that can be assigned to variable A
def Max(z-5):
import randorn as r global x;global y
String='CBSEONLINE' 2 if x>y and y>z :
A=r.randrarnge(0,4) y+=11; z-+=1; return x+5
B=9 elif x>z:
while String[B]!=L': E= y+=5; return y
print(StringlB| + StringlA] +#Tend =") else:
A=A+1 Z+=5; return z
B= B-1 P.T.O.
(8)

22. How
(9) 36-441550-241
z=Max) rmany
tines will 20 34
printbc,y,z, sep=") the output of the codetrhe loop be eneutes? Also giveebe 44
x=Maxly) %, y = 2, 50
printx,y,z, sep=)
while (x <= 10) :
the following code X+=1
21. What willbe the output of
y -=X+1
defStrFuncname):
Str=
X+=2 SD-3+4
print (x,y)
while True :
printtnameal,a)
if namela].islower):
Section -C
Str+=namela].upper 23. Write only one statement for
elif namelal. isupper): each in python to -
if (a%2) : a) convert the first character of string SEN to
upper
Str+=namela-1] case.

else : b) add 'annual' to a tuple t.


break
at=1
c) print a list L of integers in descending order.
else : d) print the value that occurs maximunm number of times
prínt(' 2024) in the list L1
print(Str)
empty the dictionaryD.

dhApPy'NEw'yeAr"2024]) P.T.O.
10 )
24. Write a function Phone Bill(calls) where calls
\s
argument which recelves no of calls made by a customeran For example
The function teturns the telephone bill of a If the list state
contairns
based on the following criteria Customer then after shifting the list ["MP"UP"WB"AP","HP)
will contain
For the first 100 calls the minimum bill
amount is [UP"WB AP"HPMP1
Rs 100
For the next40 calls Rs. 0.40 per call will be 27. Write a user defined function
extra
charged that takes the dictionary, yellowdeletedata(yellow_pages)
_pages as argument in
For the noxt 60 callsRs. 0.50 per call will be Python and deletes data of those persons whose
charged less than 5 characters from name is
xtra yellow_pages. Structure of
For the calls beyond 200 Rs. 0.60 per call wll be yellow_pages - (phoneno: [name,city])
charged extra 28. Write a user defined function
wordlen(sen) that takes a
sentence as argument and returns tuple containing length
25 Writea function INDEX LIST(L), where L is thelist of of each word of the
sentence as element.
cemets passed as argument to the function. The function
replaces allNon-Zero Elements of Lwith corresponding
index nos and returns count of elements
replaced.
26. Write a user defined function
Rotate(state) where state
is an argument It shifts the elerments
towards left. The
elernent at second position is shifted to the first
the elerrent at third position is position,
shited to the second
position and so on The elerment at the first position is
shifted to the last position

You might also like