Practice CBSE Class 11 Computer Science Dictionary in Python MCQs provided below. The MCQ Questions for Class 11 Dictionary in Python Computer Science with answers and follow the latest CBSE/ NCERT and KVS patterns. 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 review the 50 questions and answers to strengthen understanding of core concepts in Dictionary in Python
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
| CBSE Class 11 Computer Science Advanced Scripting MCQs |
| CBSE Class 11 Computer Science Animation Tool MCQs Set A |
| CBSE Class 11 Computer Science Animation Tool MCQs Set B |
| CBSE Class 11 Computer Science Basic Ubuntu Linux Commands MCQs |
| CBSE Class 11 Computer Science Boolean Algebra MCQs |
| CBSE Class 9 Computer Science Computer Components MCQs Set A |
| CBSE Class 11 Computer Science Computer Hardware MCQs |
| CBSE Class 11 Computer Science Computer Organisation MCQs |
| CBSE Class 11 Computer Science Conditional Statement MCQs |
| CBSE Class 11 Computer Science Creating Animation Using Synfig MCQs |
| CBSE Class 11 Computer Science Current Trends and Technologies MCQs |
| CBSE Class 11 Computer Science Dictionary in Python MCQs |
| CBSE Class 11 Computer Science Forms and Reports MCQs |
| CBSE Class 11 Computer Science Fundamentals of Computer MCQs |
| CBSE Class 9 Computer Science Introduction to Computers MCQs Set B |
| CBSE Class 11 Computer Science Introduction To Database Management System MCQs |
| CBSE Class 11 Computer Science Introduction To Layers MCQs |
| CBSE Class 11 Computer Science Introduction To Multimedia MCQs Set A |
| CBSE Class 11 Computer Science Introduction To Multimedia MCQs Set B |
| CBSE Class 11 Computer Science List Manipulation MCQs Set A |
| CBSE Class 11 Computer Science List Manipulation MCQs Set B |
| CBSE Class 11 Computer Science List Manipulation MCQs Set C |
| CBSE Class 11 Computer Science Python Fundamentals MCQs |
| Python Variables and Data Types MCQs with Answers |
| CBSE Class 11 Computer Science Random Function MCQs |
| CBSE Class 11 Computer Science Retrieve Data Using Queries MCQs |
| CBSE Class 11 Computer Science Society Law and Ethics MCQs |
| CBSE Class 11 Computer Science Software and Operating System MCQs |
| CBSE Class 11 Computer Science String and Function MCQs |
| CBSE Class 11 Computer Science Using Pictures In Synfig MCQs |
| CBSE Class 11 Computer Science Vim Editor and Basic Scripting MCQs Set A |
| CBSE Class 11 Computer Science Vim Editor and Basic Scripting MCQs Set B |
| CBSE Class 11 Computer Science Working With Table MCQs |
Important Practice Resources for Class 11 Computer Science
MCQs for Dictionary in Python Computer Science Class 11
Students can use these MCQs for Dictionary in Python to quickly test their knowledge of the chapter. These multiple-choice questions have been designed as per the latest syllabus for Class 11 Computer Science released by CBSE. Our expert teachers suggest that you should practice daily and solving these objective questions of Dictionary in Python to understand the important concepts and better marks in your school tests.
Dictionary in Python NCERT Based Objective Questions
Our expert teachers have designed these Computer Science MCQs based on the official NCERT book for Class 11. We have identified all questions from the most important topics that are always asked in exams. After solving these, please compare your choices with our provided answers. For better understanding of Dictionary in Python , you should also refer to our NCERT solutions for Class 11 Computer Science created by our team.
Online Practice and Revision for Dictionary in Python Computer Science
To prepare for your exams you should also take the Class 11 Computer Science MCQ Test for this chapter on our website. This will help you improve your speed and accuracy and its also free for you. Regular revision of these Computer Science topics will make you an expert in all important chapters of your course.
You can download the CBSE MCQs for Class 11 Computer Science Dictionary in Python for latest session from StudiesToday.com
Yes, the MCQs issued by CBSE for Class 11 Computer Science Dictionary in Python have been made available here for latest academic session
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.
To prepare for Dictionary in Python MCQs, refer to the concepts links provided by our teachers and download sample papers for free.
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
