Computer Science Hometest 5
Computer Science Hometest 5
HOME TEST-5
COMPUTER SCIENCE-XII A/B & C
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 10 questions carrying 01 mark each.
4. Section B has 05 Very Short Answer type questions carrying 02 marks each.
5. Section C has 02 Short Answer type questions carrying 03 marks each.
6. Section D has 01 Long Answer type questions carrying 04 marks each.
TOTAL MARKS- 30
SECTION –A 10X1=10
1.State True or False:
(A)hAPPY#HOUR1122#33 (B)Happy#hOUR12#3
(C)hAPPY#HOUR112233 (D)Happy Hour11 22 33 #
3. Consider the given expression:
17%5==2 and 4%2>0 or 15//2==7.5
Which of the following will be correct output if the given expression is evaluated?
(a)True (b) False (c)None (d)Null
4. Select the correct output of the code:
s = "Question paper 2022-23"
s= s.split('2')
print(s)
a. ['Question paper ', '0', '', '-', '3'] b. ('Question paper ', '0', '', '-', '3')
c. ['Question paper ', '0', '2', '', '-', '3'] d. ('Question paper ', '0', '2', '', '-', '3')
(a) (10,20) (b) (10,) (c) (10) (d) All are tuples.
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 > d2
b=5
def myfun(a):
# missing statement.
b=b*a
myfun(14)
print(b)
Which of the following statements should be given in the blank for # Missing statement, if the output
produced is 70?
SECTION B 5x2=10
11. Write difference between mutable and immutable property, Explain it with its example.
12. Write the Python statement for each of the following tasks using BUILT_IN functions/ methods only:
i) str="PYTHON@LANGUAGE"
13. What possible outputs are expected to be displayed on the screen at the time of execution of the
program from the following code?
import random
temp=[10,20,30,40,50,60]
c=random.randint(0,4)
for i in range(0, c):
print(temp[i],”#”)
a) 10#20# b) 10#20#30#40#50# c) 10#20#30# d) 50#60#
14. Write the Python statement for each of the following tasks using BUILT_IN functions/ methods only:
import random as r
Lower =r.randint(1,3)
Upper =r.randint(2,4)
print (AR[K],end=”#“)
n1= n1 * n2
n2= n2 + 2
print(n1, n2)
func( )
func(2,3)
SECTION –D 1X4=4