
11/29: Dictionary Review
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
GWC Lowell
Used 1+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of these dictionaries has integers as the keys and strings as the values?
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the value of supplies after this code is run?
{"pencil": 12,
"paper": 70, "notebooks": 10, "eraser": 20, "highlighters": 25}
{"pencil": 12,
"paper": 70, "notebooks": 10, "eraser": 20}
{"pencil": 12,
"paper": 30, "notebooks": 10, "eraser": 20,
"paper": 40, "highlighters": 25}
{"pencil": 12,
"paper": 40, "notebooks": 10, "eraser": 20, "highlighters": 25}
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the line of code to initialize an empty dictionary called thesaurus?
thesaurus = new Dictionary()
thesaurus = empty_dict()
thesaurus = {}
thesaurus = []
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will the following code output?
["veggie burger", "salad", "soda"]
KeyError
"fries"
["hot dog", "apple slices", "orange juice"]
Answer explanation
There is no key:value pair in this dictionary with a key of 3, so this code will produce an error.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the following code output?
True
False
KeyError
10
Answer explanation
This code checks for the existence of "notebooks" as a key in the dictionary. Since it exists as a key, it will print True.
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
Answer explanation
This loop goes through each key in the dictionary and prints it.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will the following code output?
True
KeyError
0
False
Answer explanation
This code checks for the existence of "pen" as a key in the dictionary. "pen" is not a key.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
12 questions
website design elements
Quiz
•
12th Grade
10 questions
Latihan Class Library
Quiz
•
9th - 12th Grade
10 questions
ICT as Social Change
Quiz
•
12th Grade
10 questions
Iterative Development Process
Quiz
•
9th - 12th Grade
15 questions
Environmental Impacts
Quiz
•
9th - 12th Grade
15 questions
M2S5P1
Quiz
•
12th Grade
10 questions
1.1 - System Architecture - CPU [OCR] [GCSE]
Quiz
•
9th - 12th Grade
10 questions
ระบบทางเทคโนโลยี ม.4
Quiz
•
10th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
