
11/29: Dictionary Review
Quiz
•
Computers
•
12th Grade
•
Medium
GWC Lowell
Used 1+ times
FREE Resource
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.
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
12 questions
1.2.4. Types of Programming Language
Quiz
•
12th Grade
10 questions
แบบทดสอบเรื่องระบบคอมพิวเตอร์และการสื่อสาร
Quiz
•
9th - 12th Grade
8 questions
Basic computer
Quiz
•
9th - 12th Grade
13 questions
Programming Concepts Quiz
Quiz
•
6th Grade - University
15 questions
Imaging and Design
Quiz
•
11th - 12th Grade
10 questions
Cyber Security Quiz
Quiz
•
12th Grade
10 questions
Visual Basic 2010
Quiz
•
8th Grade - University
12 questions
Remidi TLJ
Quiz
•
12th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
11 questions
NEASC Extended Advisory
Lesson
•
9th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade