Exam 9: Dictionaries and Sets
Exam 1: Introduction to Computers and Programming36 Questions
Exam 2: Input, Processing, and Output35 Questions
Exam 3: Decision Structures and Boolean Logic35 Questions
Exam 4: Repetition Structures34 Questions
Exam 5: Functions and Modules69 Questions
Exam 6: Files and Exceptions34 Questions
Exam 7: Lists and Tuples35 Questions
Exam 8: More About Strings35 Questions
Exam 9: Dictionaries and Sets35 Questions
Exam 10: Classes and Object Oriented Programming35 Questions
Exam 11: Inheritance35 Questions
Exam 12: Recursion35 Questions
Exam 13: GUI Programming35 Questions
Select questions type
What is the process used to convert an object to a stream of bytes that can be saved in a file?
Free
(Multiple Choice)
4.8/5
(78)
Correct Answer:
A
The _______________ method clears the contents of a dictionary.
Free
(Short Answer)
4.8/5
(81)
Correct Answer:
clear
Which statement would you use to delete an existing key-value pair from a dictionary?
(Multiple Choice)
4.9/5
(64)
Which method would you use to return the value associated with a specified key and remove that key-value pair from the dictionary?
(Multiple Choice)
4.8/5
(74)
To add a single item to a set, you can use the set method _______________.
(Short Answer)
4.8/5
(85)
What does the get method do if the specified key is not found in the dictionary?
(Multiple Choice)
4.8/5
(81)
You would typically use a for loop to iterate over the elements in a set.
(True/False)
4.9/5
(83)
What would be the result of the following code?
Ages = {'Aaron' : 6, 'Kelly' : 3, 'Abigail' : 1 }
Value = ages['Brianna']
(Multiple Choice)
5.0/5
(74)
Each element in a(n) _______________ has two parts: a key and a value.
(Short Answer)
4.8/5
(78)
What is the number of the first index in a list dictionary?
(Multiple Choice)
4.8/5
(77)
In a dictionary, you use a(n) _____ to locate a specific value.
(Multiple Choice)
4.8/5
(86)
To write an object to a file, you use the _______________ function of the _______________ module.
(Short Answer)
4.9/5
(74)
The union of two sets is a set that contains only the elements that appear in both sets.
(True/False)
4.9/5
(73)
A(n) _______________ is an object that holds multiple unique items of data in an unordered manner.
(Short Answer)
4.7/5
(85)
Which function would you use to get the number of elements in a dictionary?
(Multiple Choice)
4.8/5
(82)
A dictionary can include the same value several times, but cannot include the same key several times.
(True/False)
4.8/5
(80)
Showing 1 - 20 of 35
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)