CBSE Class 11 Computer Science Dictionary in Python MCQs

Refer to CBSE Class 11 Computer Science Dictionary in Python MCQs provided below available for download in Pdf. The MCQ Questions for Class 11 Computer Science with answers are aligned as per the latest syllabus and exam pattern suggested by CBSE, NCERT and KVS. Multiple Choice Questions for Dictionary in Python are an important part of exams for Class 11 Computer Science and if practiced properly can help you to improve your understanding and get higher marks. Refer to more Chapter-wise MCQs for CBSE Class 11 Computer Science and also download more latest study material for all subjects

MCQ for Class 11 Computer Science Dictionary in Python

Class 11 Computer Science students should refer to the following multiple-choice questions with answers for Dictionary in Python in Class 11.

Dictionary in Python MCQ Questions Class 11 Computer Science with Answers

Question. What will be the output of the following Python code?
a={1:5,2:3,3:4}
a.pop(3)
print(a)
a) {1: 5}
b) {1: 5, 2: 3}
c) Error, syntax error for pop() method
d) {1: 5, 3: 4}

Answer : B

Question. In order to store values in terms of key and value we use what core data type
a) list
b) tuple
c) class
d) dictionary

Answer : D

Question. What will be the output?
d = {“john”:40, “peter”:45}

“john” in d
a) True
b) False
c) None
d) Error

Answer : A

Question. Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command do we use:
a) d.delete(“john”:40)
b) d.delete(“john”)
c) del d[“john”]
d) del d(“john”:40)

Answer : C

Question. Which one of the following is correct?
a) In python, a dictionary can have two same keys with different values.
b) In python, a dictionary can have two same values with different keys
c) In python, a dictionary can have two same keys or same values but cannot have two same key-value pair
d) In python, a dictionary can neither have two same keys nor two same values.

Answer : A

Question. Which of the following will give error?
Suppose dict1={“a”:1,”b”:2,”c”:3}
a) print(len(dict1))
b) print(dict1.get(“b”))
c) dict1[“a”]=5
d) None of these.

Answer : D

Question. Which of the following is not a declaration of the dictionary?
a) {1: ‘A’, 2: ‘B’}
b) dict([[1,”A”],[2,”B”]])
c) {1,”A”,2”B”}
d) { }

Answer : C

Question. What will be the output of the following Python code?
a={1:”A”,2:”B”,3:”C”}
b=a.copy()
b[2]=”D”
print(a)
a) Error, copy() method doesn’t exist for dictionaries
b) {1: ‘A’, 2: ‘B’, 3: ‘C’}
c) {1: ‘A’, 2: ‘D’, 3: ‘C’}
d) “None” is printed

Answer : B

Question. What is the output of the following code?
a={1:”A”,2:”B”,3:”C”}
for i,j in a.items():
print(i,j,end=” “)
a) 1 A 2 B 3 C
b) 1 2 3
c) A B C
d) 1:”A” 2:”B” 3:”C”

Answer : A

Question. Which of the following statements create a dictionary?
a) d = {}
b) d = {“john”:40, “peter”:45}
c) d = {40:”john”, 45:”peter”}
d) All of the mentioned

Answer : D

Question. What will be the output?
d1 = {“john”:40, “peter”:45}
d2 = {“john”:466, “peter”:45}
d1 > d2
a) True
b) False
c) Error
d) None

Answer : C

Question. Which of the following is correct with respect to above Python code? d = {“a”:3 ,”b”: 7}
print(list(d.keys()))
a) a dictionary d is created.
b) a and b are the keys of dictionary d.
c) 3 and 7 are the values of dictionary d
d) All of the above.

Answer : D

Question. Which of the following will delete key_value pair for key=”tiger” in dictionary?
dic={“lion”:”wild”, “tiger”:”wild”, “cat”:”domestic”, “dog”:”domestic”}
a) del dic[“tiger”]
b) dic[“tiger”].delete()
c) delete(dic.[“tiger”])
d) del(dic.[“tiger”])

Answer : A

Question. What will be the output of the following Python code snippet?
a={1:”A”,2:”B”,3:”C”}
print(a.get(1,4))
a) 1
b) A
c) 4
d) Invalid syntax for get method

Answer : A

Question. What will be the output of the following Python code?
a={1:”A”,2:”B”,3:”C”}
a.clear()
print(a)
a) None
b) { None:None, None:None, None:None}
c) {1:None, 2:None, 3:None}
d) { }

Answer : D

Question. What is the output of the following code?
a={1:”A”,2:”B”,3:”C”}
for i,j in a.items():
print(i,j,end=” “)
a) 1 A 2 B 3 C
b) 1 2 3
c) A B C
d) 1:”A” 2:”B” 3:”C”

Answer : A

Question. What is the output of the following code?
a={1:”A”,2:”B”,3:”C”}

print(a.setdefault(3))
a) {1: ‘A’, 2: ‘B’, 3: ‘C’} c) d)
b) C
c) {1: 3, 2: 3, 3: 3}
d) No method called setdefault() exists for dictionary

Answer : B

Question. What is the output? d = {“john”:40, “peter”:45}
d[“john”]
a) 40
b) 45
c) “john”
d) “peter”

Answer : A

Question. What will be the output of above Python code?
d1={“abc”:5,”def”:6,”ghi”:7}
print(d1[0])
a) abc
b) 5
c) {“abc”:5}
d) Error

Answer : D

Question. Which of the following Python codes will give same output if
(i) dict.pop(“book”)
(ii) del dict[“book”]
(iii) dict.update({“diary”:1,”novel”:5})
dict={“diary”:1,”book”:3,”novel”:5}
a) i, ii, iii
b) i, ii
c) i, iii
d) ii, iii

Answer : B

Question. What will be the output of the following Python code snippet?
a={1:”A”,2:”B”,3:”C”}
a.setdefault(4,”D”)
print(a)
a) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’}
b) None
c) Error
d) [1,3,6,10]

Answer : A

Question. Read the code shown below carefully and pick out the keys?
d = {“john”:40, “peter”:45}
a) “john”, 40, 45, and “peter”
b) “john” and “peter”
c) 40 and 45
d) d = (40:”john”, 45:”peter”)

Answer : B

Question. Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use?
a) d.size()
b) len
c) size
d) d.len()

Answer : B

Question. What will be the output?
d = {“john”:40, “peter”:45}
print(list(d.keys()))
a) [“john”, “peter”]
b) [“john”:40, “peter”:45]
c) (“john”, “peter”)
d) (“john”:40, “peter”:45)

Answer : A

Question. What will be the output of above Python code?
d1={“abc”:5,”def”:6,”ghi”:7}
print(d1[0])
a) abc
b) 5
c) {“abc”:5}
d) Error

Answer : D

Question. What will be the output of the following Python code snippet?
a={1:”A”,2:”B”,3:”C”}
print(a.get(5,4))
a) 1
b) A
c) 4
d) Invalid syntax for get method

Answer : C

Question. What will be the output of the following Python code?
a={1:”A”,2:”B”,3:”C”}
for i in a:
print(i,end=” “)
a) 1 2 3
b) ‘A’ ‘B’ ‘C’
c) 1 ‘A’ 2 ‘B’ 3 ‘C’
d) Error, it should be: for i in a.items():

Answer : A

Question. What will be the output?
d1 = {“john”:40, “peter”:45}
d2 = {“john”:466, “peter”:45}
d1 == d2
a) True
b) False
c) None
d) Error

Answer : B

Question. What will the below Python code do?
dict={“Phy”:94,”Che”:70,”Bio”:82,”Eng”:95}
dict.update({“Che”:72,”Bio”:80})
a) It will create new dictionary as dict={“Che”:72,”Bio”:80} and old dict will be deleted.
b) It will throw an error as dictionary cannot be updated.
c) It will simply update the dictionary as dict={“Phy”:94,”Che”:72,”Bio”:80,”Eng”:95}
d) It will not throw any error but it will not do any changes in dict

Answer : C

Question. Keys of the dictionary must be :
a) Similar
b) Unique
c) Can be similar or unique
d) All of these

Answer : B

Question. 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) Dictionaries are mutable

Answer : B

Question. What will be the output of the following Python code?
>>> a={1:”A”,2:”B”,3:”C”}
>>> a.items()
a) Syntax error
b) dict_items([(‘A’), (‘B’), (‘C’)])
c) dict_items([(1,2,3)])
d) dict_items([(1, ‘A’), (2, ‘B’), (3, ‘C’)])

Answer : D

MCQs for Dictionary in Python Computer Science Class 11

Expert teachers of studiestoday have referred to NCERT book for Class 11 Computer Science to develop the Computer Science Class 11 MCQs. If you download MCQs with answers for the above chapter you will get higher and better marks in Class 11 test and exams in the current year as you will be able to have stronger understanding of all concepts. Daily Multiple Choice Questions practice of Computer Science will help students to have stronger understanding of all concepts and also make them expert on all critical topics. After solving the questions given in the MCQs which have been developed as per latest books also refer to the NCERT solutions for Class 11 Computer Science. We have also provided lot of MCQ questions for Class 11 Computer Science so that you can solve questions relating to all topics given in each chapter. After solving these you should also refer to Class 11 Computer Science MCQ Test for the same chapter.

Where can I download latest CBSE MCQs for Class 11 Computer Science Dictionary in Python

You can download the CBSE MCQs for Class 11 Computer Science Dictionary in Python for latest session from StudiesToday.com

Are the Class 11 Computer Science Dictionary in Python MCQs available for the latest session

Yes, the MCQs issued by CBSE for Class 11 Computer Science Dictionary in Python have been made available here for latest academic session

Where can I find CBSE Class 11 Computer Science Dictionary in Python MCQs online?

You can find CBSE Class 11 Computer Science Dictionary in Python MCQs on educational websites like studiestoday.com, online tutoring platforms, and in sample question papers provided on this website.

How can I prepare for Dictionary in Python Class 11 MCQs?

To prepare for Dictionary in Python MCQs, refer to the concepts links provided by our teachers and download sample papers for free.

Are there any online resources for CBSE Class 11 Computer Science Dictionary in Python ?

Yes, there are many online resources that we have provided on studiestoday.com available such as practice worksheets, question papers, and online tests for learning MCQs for Class 11 Computer Science Dictionary in Python