Python Dictionary

Quiz
•
Computers
•
•
Medium
ASIER SOLUTIONS
Used 33+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not a valid way to define this dictionary in Python:
d = dict([
('foo', 100),
('bar', 200),
('baz', 300)
])
d = {}
d['foo'] = 100
d['bar'] = 200
d['baz'] = 300
d = dict(foo=100, bar=200, baz=300)
d = {'foo': 100, 'bar': 200, 'baz': 300}
d = { ('foo', 100), ('bar', 200), ('baz', 300) }
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Consider this dictionary:
d = {'foo': 100, 'bar': 200, 'baz': 300}
What is the result of this statement:
d['bar':'baz']
It raises an exception
(200, 300)
200 300
[200, 300]
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
A Python dictionary stores ...
value - key pairs
key - value pairs
4.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following create an empty dictionary (D)?
D = dict()
D = ()
D = []
D = {}
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Please select all correct ways to empty the following dictionary
student = {
"name": "Emma",
"class": 9,
"marks": 75
}
del student
del student[0:2]
student.clear()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
________________method will returns number of key-value pairs in the given dictionary.
len( )
pop( )
del( )
keys( )
values( )
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Python quiz

Quiz
•
10th Grade - Professi...
10 questions
Dictionary in Python

Quiz
•
11th - 12th Grade
9 questions
Python

Quiz
•
University
15 questions
Py-Hackathon - Week 2 - Day 2

Quiz
•
University
11 questions
DIctionary

Quiz
•
11th Grade
15 questions
Exploring Python Data Structures Quiz

Quiz
•
10th Grade
10 questions
Kodla Büyü 3

Quiz
•
7th Grade
6 questions
Python Day 9

Quiz
•
University
Popular Resources on Wayground
10 questions
SR&R 2025-2026 Practice Quiz

Quiz
•
6th - 8th Grade
30 questions
Review of Grade Level Rules WJH

Quiz
•
6th - 8th Grade
6 questions
PRIDE in the Hallways and Bathrooms

Lesson
•
12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
15 questions
Subtracting Integers

Quiz
•
7th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
25 questions
Chromebook Quiz!

Quiz
•
7th Grade
8 questions
Time Management

Quiz
•
6th Grade
22 questions
College Terms

Quiz
•
8th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
15 questions
Acceptable Use Policy (Quiz)

Quiz
•
6th - 8th Grade
18 questions
Digital Footprint

Quiz
•
6th Grade
15 questions
MyROBS Knowledge Check

Quiz
•
5th Grade