Page 41 - PYTHON-12
P. 41
17. Which protocol is used to retrieve email messages from a mail server? (1)
(a) FTP (b) POP3
(c) HTTP (d) IMAP
18. Identify the device that is used to amplify and regenerate signals to extend the range of a communication
signal. (1)
(a) Router (b) Repeater
(c) Switch (d) Hub
19. Which switching technique is most commonly used in the internet to handle data traffic? (1)
Q20 and Q21 are Assertion (A) and Reasoning (R) 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 but R is not the correct explanation for A.
(c) A is true but R is false.
(d) A is false but R is true.
20. Assertion (A): Default arguments in Python functions are evaluated only once when the function is defined.
Reasoning (R): This is because default arguments are mutable and retain any changes made during function
calls. (1)
21. Assertion (A): COUNT() function in SQL can be used with DISTINCT keyword to count unique values in a
column.
Reasoning (R): COUNT() function only counts the number of rows and does not consider distinct values by
default. (1)
Section B
22. What is the difference between a list and a tuple in Python? Write the syntax to define a list and a tuple. (2)
23. Write two ways to create a duplicate list. (2)
24. Answer the following using built-in functions only.
If Dict1 = {'aa': 1, 'bb': 2, 'cc': 3, 'dd': 4, ...} and Dict2 = {'x1':
10, 'y1': 20, 'z1': 30, ...}, then (2)
(I) (A) Write a statement to get the value associated with the key ‘bb’ in Dict1.
OR
(B) Write a statement to add a new key-value pair 'dd':5 to the dictionary Dict1.
(II) (A) Write a statement to update Dict1 with all key-value pairs from Dict2.
OR
(B) Write a statement to remove the key ‘aa’ from Dict1.
25. From the given options, identify the correct output(s) of the following code. Write the minimum and
maximum possible values of the variable c. (2)
import random
text = "CodingSkills"
c = random.randint(3, 6)
for i in range(len(text)-1, c-1, -2):
print(text[i], end='|')
(a) c| (b) s|l|
(c) s|l|k| (d) s|l|k|c|
A.4 Computer Science–XII