1.
To which of the following the “in” operator can be used to check if an item is in it?
A. 
B. 
C. 
D. 
2.
Which of the following is a Python tuple?
A. 
B. 
C. 
D. 
3.
Suppose t = (1, 2, 4, 3), which of the following is incorrect?
A. 
B. 
C. 
D. 
4.
What will be the output of the following Python code?
>>>t=(1,2,4,3)
>>>t[1:3]
A. 
B. 
C. 
D. 
5.
What will be the output of the following Python code?
>>>t=(1,2,4,3)
>>>t[1:-1]
A. 
B. 
C. 
D. 
6.
What will be the output of the following Python code?
>>>t = (1, 2, 4, 3, 8, 9)
>>>[t[i] for i in range(0, len(t), 2)]
A. 
B. 
C. 
D. 
7.
What will be the output of the following Python code?
d = {"john":40, "peter":45}
d["john"]
A. 
B. 
C. 
D. 
8.
What will be the output of the following Python code?
>>>t = (1, 2)
>>>2 * t
A. 
B. 
C. 
D. 
9.
What will be the output of the following Python code?
>>>t1 = (1, 2, 4, 3)
>>>t2 = (1, 2, 3, 4)
>>>t1 < t2
A. 
B. 
C. 
D. 
10.
Which of the following statements create a dictionary?
A. 
B. 
D = {“john”:40, “peter”:45}
C. 
D = {40:”john”, 45:”peter”}
D. 
11.
What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
A. 
“john”, 40, 45, and “peter”
B. 
C. 
D. 
D = (40:”john”, 45:”peter”)
12.
What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
"john" in d
A. 
B. 
C. 
D. 
13.
Which of these about a dictionary is false?
A. 
The values of a dictionary can be accessed using keys
B. 
The keys of a dictionary can be accessed using values
C. 
Dictionaries aren’t ordered
D. 
14.
Which of the following is not a declaration of the dictionary?
A. 
B. 
C. 
D. 
15.
What will be the output of the following Python code snippet?
a={1:"A",2:"B",3:"C"}
for i,j in a.items():
print(i,j,end=" ")
A. 
B. 
C. 
D. 
16.
What will be the output of the following Python code snippet?
a={1:"A",2:"B",3:"C"}
print(a.get(1,4))
A. 
B. 
C. 
D. 
Invalid syntax for get method
17.
What will be the output of the following Python code snippet?
a={1:"A",2:"B",3:"C"}
print(a.get(5,4))
A. 
B. 
C. 
D. 
18.
Which of the statements about dictionary values if false?
A. 
More than one key can have the same value
B. 
The values of the dictionary can be accessed as dict[key]
C. 
Values of a dictionary must be unique
D. 
Values of a dictionary can be a mixture of letters and numbers
19.
What will be the output of the following Python code snippet?
>>> a={1:"A",2:"B",3:"C"}
>>> del a
A. 
Method del doesn’t exist for the dictionary
B. 
Del deletes the values in the dictionary
C. 
Del deletes the entire dictionary
D. 
Del deletes the keys in the dictionary
20.
If a is a dictionary with some key-value pairs, what does a.popitem() do?
A. 
Removes an arbitrary element
B. 
Removes all the key-value pairs
C. 
Removes the key-value pair for the key given as an argument
D. 
Invalid method for dictionary