Humanities/Arts Exam  >  Humanities/Arts Tests  >  Computer Science for Class 11  >  Test: Dictionaries in Python - Humanities/Arts MCQ

Test: Dictionaries in Python - Humanities/Arts MCQ


Test Description

10 Questions MCQ Test Computer Science for Class 11 - Test: Dictionaries in Python

Test: Dictionaries in Python for Humanities/Arts 2024 is part of Computer Science for Class 11 preparation. The Test: Dictionaries in Python questions and answers have been prepared according to the Humanities/Arts exam syllabus.The Test: Dictionaries in Python MCQs are made for Humanities/Arts 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Dictionaries in Python below.
Solutions of Test: Dictionaries in Python questions in English are available as part of our Computer Science for Class 11 for Humanities/Arts & Test: Dictionaries in Python solutions in Hindi for Computer Science for Class 11 course. Download more important topics, notes, lectures and mock test series for Humanities/Arts Exam by signing up for free. Attempt Test: Dictionaries in Python | 10 questions in 10 minutes | Mock test for Humanities/Arts preparation | Free important questions MCQ to study Computer Science for Class 11 for Humanities/Arts Exam | Download free PDF with solutions
Test: Dictionaries in Python - Question 1

What will be the output of the following Python code snippet?

d = {"john":40, "peter":45}

Detailed Solution for Test: Dictionaries in Python - Question 1

Dictionaries appear in the form of keys and values.

Test: Dictionaries in Python - Question 2

What will be the output of the following Python code snippet?

d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 == d2

Detailed Solution for Test: Dictionaries in Python - Question 2

If d2 was initialized as d2 = d1 the answer would be true.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Dictionaries in Python - Question 3

What will be the output of the following Python code snippet?

d = {"john":40, "peter":45}
d["john"]

Detailed Solution for Test: Dictionaries in Python - Question 3

Execute in the shell to verify.

Test: Dictionaries in Python - Question 4

Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use?

Detailed Solution for Test: Dictionaries in Python - Question 4

Execute in the shell to verify.

Test: Dictionaries in Python - Question 5

Suppose d = {“john”:40, “peter”:45}, what happens when we try to retrieve a value using the expression d[“susan”]?

Detailed Solution for Test: Dictionaries in Python - Question 5

Execute in the shell to verify.

Test: Dictionaries in Python - Question 6

Which of the following statements create a dictionary?

Detailed Solution for Test: Dictionaries in Python - Question 6

Dictionaries are created by specifying keys and values.

Test: Dictionaries in Python - Question 7

What will be the output of the following Python code snippet?

Participate in Python Programming Certification Contest of the Month Now!
d = {"john":40, "peter":45}
"john" in d

Detailed Solution for Test: Dictionaries in Python - Question 7

In can be used to check if the key is int dictionary.

Test: Dictionaries in Python - Question 8

What will be the output of the following Python code snippet?

d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 > d2

Detailed Solution for Test: Dictionaries in Python - Question 8

Arithmetic > operator cannot be used with dictionaries.

Test: Dictionaries in Python - Question 9

 Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command do we use?

Detailed Solution for Test: Dictionaries in Python - Question 9

Execute in the shell to verify.

Test: Dictionaries in Python - Question 10

What will be the output of the following Python code snippet?

d = {"john":40, "peter":45}
print(list(d.keys()))

Detailed Solution for Test: Dictionaries in Python - Question 10

The output of the code shown above is a list containing only keys of the dictionary d, in the form of a list.

20 videos|20 docs|5 tests
Information about Test: Dictionaries in Python Page
In this test you can find the Exam questions for Test: Dictionaries in Python solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Dictionaries in Python, EduRev gives you an ample number of Online tests for practice

Top Courses for Humanities/Arts

20 videos|20 docs|5 tests
Download as PDF

Top Courses for Humanities/Arts