GRADE: XI PRE ANNUAL EXAMINATION MARKS :
50
SUBJECT : COMPUTER SCIENCE DURATION : 90
MINS
GENERAL INSTRUCTIONS :
1. This question paper contains three sections, Section A to C.
2. All questions are compulsory.
3. Section A have 21 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 03 Long Answer type questions carrying 05 marks each.
6. All programming questions are to be answered using Python Language only.
SEC – A 21 X 1 =
21
1. State True of False.
"Identifiers are names used to identify a variable, function in a program".
2. Which of the following is a valid keyword in Python?
(a) false (b) return (c) non_local (d) none
3. Given the following Tuple
Tup= (10, 20, 30, 50)
Which of the following statements will result in an error?
(a) print(Tup[0]) (b) Tup.insert (2,3) (c) print(Tup[1:2]) (d)
print(len(Tup))
4. Consider the given expression:
5<10 and 12>7 or not 7>4
Which of the following will be the correct output, if the given expression is
evaluated?
(a) True (b) False (c) NONE (d) NULL
5. Select the correct output of the code:
S= "Amrit Mahotsav @ 75"
A=S.partition (" ")
print (A)
(a) ('Amrit Mahotsav', '@', '75') (b) ['Amrit', 'Mahotsav', '@', '75']
(c) ('Amrit', 'Mahotsav @ 75') (d) ('Amrit', '', 'Mahotsav @ 75')
6. Which of the following operators will return either True or False?
(a) += (b) != (c) = (d) *=
7. What will the following expression be evaluated to in Python?
print(4+3*5/3–5%2)
(a) 8.5 (b) 8.0 (c) 10.2 (d) 10.0
8. Which of the following statement(s) would give an error after executing the
following code?
stud={"Murugan":100, "Mithu":95} # Statement 1
print (stud[95]) # Statement 2
Stud ["Murugan"]=99 # Statement 3
print(Stud.pop()) # Statement 4
print(Stud) # Statement 5
(a) Statement 2 (b) Statement 3 (c) Statement 4 (d) Statement
2 and 4
9. Select the correct output of the code:
a = "Year 2022 at All the best"
a = a.split('2')
b = a[0] + ". " + a[1] + ". " + a[3]
print (b)
(a) Year . 0. at All the best (b) Year 0. at All the best
(c) Year . 022. at All the best (d) Year . 0. at all the best
10. Which of the following statement(s) would give an error after executing the
following code?
S="Welcome to class XII" # Statement 1
print(S) # Statement 2
S="Thank you" # Statement 3
S[0]= '@' # Statement 4
S=S+"Thank you" # Statement 5
(a) Statement 3 (b) Statement 4 (c) Statement 5 (d) Statement 4 and 5
11.Which of the following data type in Python supports concatenation?
a) int b) float c) bool d) str
12.What will be output of the following code:
d1={1:2,3:4,5:6}
d2=d1.popitem()
print(d2)
(a){1:2} (b){5:6} (c)(1,2) (d)(5,6)
13.What will be the value of y when following expression be evaluated in Python?
x=10.0
y=(x<100.0) and x>=10
(a)110 (b)False (c)Error (d)True
14. State True or False:
“Python is a case sensitive language i.e. upper and lower cases are treated
differently.”
15. What will be the output of the following statement:
print(5-2**2**2+99//11)
(a) -20 (b) -2.0 (c) -2 (d) Error
16. Select the correct output of the code:
for i in "QUITE":
print(i.lower(), end="#")
(a) q#u#i#t#e# (b) ['quite#’] (c) ['quite'] # (d)
[‘q’]#[‘u’]#[‘i’]#[‘t’]#[‘e’]#
17. Consider The following:
t=(12,13,14,16,[2,3])
What changes will be made in t after the execution of the following
statement?
t.append(4)
(i) t=(12,13,14,16,[2,3],4) (ii) t= (12,13,14,16,[2,3,4])
(iii) t=(4,12,13,14,16,12,3) (iv) t=It will give an error
18. The base values of binary, octal and hexadecimal are
a. 10, 80 and 160 respectively. b. 4, 8 and 16 respectively.
c. 2, 8 and 16 respectively. d. 1, 8 and 16 respectively.
ASSERTION AND REASONING 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
19. Assertion (A): Exception handling is responsible for handling anomalous
situations during the execution of a program.
Reason(R): Exception handling handles all types of errors and exceptions.
20.Assertion (A): The break statement can be used with all selection and
iteration statements.
Reason(R): Using break with if statement will give no error.
21. Assertion(A) : A tuple can be concatenated to a list, but a list cannot be
concatenated to a tuple.
Reason(R): Lists are mutable and tuples are immutable in Python
SEC – B 7x2=
14
22. What is active and passive footprints?
23. Write about any 2 types of virus.
24. What is a Utility Software? Explain it with an example.
25. What are break and continue statements? Explain it with an example.
26. Why sort() method not used in tuple?
27. What is cyberstalking?
28. What possible outputs (s) are expected to be displayed on screen at the time
of
execution of the program from the following code? Also specify the maximum
values that can be assigned to each of the variables FROM and TO.
import random
AR=[20,30,40,50,60,70]
FROM=random.randint(1,3)
TO=random.randint(2,4)
for K in range(FROM,TO+1):
print(AR[K],end=”#“ )
(i)10#40#70# (ii)30#40#50# (iii)50#60#70#
(iv)40#50#70#
SEC – C 3x5=
15
29. (i) Given is a Python string declaration:
1
myexam="@@CBSE Examination 2022@@"
Write the output of: print(myexam[::-2])
(ii) Write the output of the code given below:
2
my_dict = {"name": "Aman", "age": 26}
my_dict['age'] = 27
my_dict['address'] = "Delhi"
print(my_dict.items())
(iii) Find and write the output of the following python code: 2
d={}
d[100]=100
d['100']=200
d[100.0]=50
sum=0
print(d)
for i in d:
sum+=d[int(i)]
print(sum)
30. (i) Predict the output of the code given below:
s="welcome2cs"
n = len(s)
m=""
for i in range(0, n):
if (s[i] >= 'a' and s[i] <= 'm'):
m = m +s[i].upper()
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m +s[i-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m +'&'
print(m)
(ii) Predict the output of the Python code given below:
tuple1=(11,22,33,44,55,66)
list1=list(tuple1)
new_list=[]
for i in list1:
if i%2==0:
new_list.append(i)
new_tuple=tuple(new_list)
print(new_tuple)
31. (i).Name the Python Library module which needs to be imported to invoke the
following function –(i) lower( ) (ii) sin( )
(ii). Which function is used to remove leading and trailing whitespaces of
a string?
(iii). Name the function/method required to:
(i) Check if a string contains only digits.
(ii) To remove the item from the given position in the list.
(iv). Write the output of the following:
T1=('a')*3
print(T1)
print(type(T1))
(v). Write the output of the code given below:
p=10
q=20
p*=q//3
p=q**2
q+=p
print(p,q)