
Python Dictionaries - Quiz 2

Quiz
•
Computers
•
10th Grade - University
•
Hard
Talal Saleh
Used 8+ times
FREE Resource
Student preview

13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of these about a dictionary is false?
The values of a dictionary can be accessed using keys
The keys of a dictionary can be accessed using values
Dictionaries aren’t ordered
Dictionaries are mutable
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following is not a declaration of the dictionary?
d = {1: ‘A’, 2: ‘B’}
d = dict([[1,”A”],[2,”B”]])
d = {1,”A”,2”B”}
d = { }
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following Python code snippet?
a={1:"A",2:"B",3:"C"}
for i,j in a.items():
print(i,j,end=" ")
1 A 2 B 3 C
1 2 3
A B C
1:”A” 2:”B” 3:”C”
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following Python code? a={1:"A",2:"B",3:"C"} b={4:"D",5:"E"} a.update(b) print(a)
{1: ‘A’, 2: ‘B’, 3: ‘C’}
Method update() doesn’t exist for dictionaries
{1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}
{4: ‘D’, 5: ‘E’}
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
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)
Error, copy() method doesn’t exist for dictionaries
{1: ‘A’, 2: ‘B’, 3: ‘C’}
{1: ‘A’, 2: ‘D’, 3: ‘C’}
“None” is printed
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following Python code?
a={1:"A",2:"B",3:"C"}
a.clear() print(a)
None
{ None:None, None:None, None:None}
{1:None, 2:None, 3:None}
{ }
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following Python code?
a={1:"A",2:"B",3:"C"}
for i in a:
print(i,end=" ")
1 2 3
‘A’ ‘B’ ‘C’
1 ‘A’ 2 ‘B’ 3 ‘C’
Error, it should be: for i in a.items():
Create a free account and access millions of resources
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