31. |
Which of the following statements is used to create an empty set?
|
||||||||
Answer:
Option (b) |
32. |
If a={5,6,7,8}, which of the following statements is false?
|
||||||||
Answer:
Option (d) |
33. |
If a={5,6,7}, what happens when a.add(5) is executed?
|
||||||||
Answer:
Option (b) |
34. |
What will be the output of the following Python code?
>>> a={5,6,7,8} >>> b={7,5,6,8} >>> a==b
|
||||
Answer:
Option (a) |
35. |
Which of the following statements create a dictionary?
|
||||||||
Answer:
Option (d) |
36. |
Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command do we use?
|
||||||||
Answer:
Option (c) |
37. |
Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in a dictionary which command do we use?
|
||||||||
Answer:
Option (b) |
38. |
Suppose d = {“john”:40, “peter”:45}, what happens when we try to retrieve a value using the expression d[“susan”]?
|
||||||||
Answer:
Option (c) |
39. |
Which of these about a dictionary is false?
|
||||||||
Answer:
Option (b) |
40. |
Which of the following is not a declaration of the dictionary?
|
||||||||
Answer:
Option (c) |