Exam 9: Dictionaries and Sets
Exam 1: Introduction to Computers and Programming39 Questions
Exam 2: Input, Processing, and Output40 Questions
Exam 3: Decision Structures and Boolean Logic40 Questions
Exam 4: Repetition Structures41 Questions
Exam 5: Functions66 Questions
Exam 6: Files and Exceptions40 Questions
Exam 7: Lists and Tuples40 Questions
Exam 8: More About Strings37 Questions
Exam 9: Dictionaries and Sets39 Questions
Exam 10: Classes and Object-Oriented Programming38 Questions
Exam 11: Inheritance36 Questions
Exam 12: Recursion35 Questions
Exam 13: Gui Programming42 Questions
Select questions type
What is the correct structure to create a dictionary of months where each month will be accessed by its month number (for example,January is month 1,April is month 4)?
Free
(Multiple Choice)
4.9/5
(78)
Correct Answer:
B
A dictionary can include the same value several times but cannot include the same key several times.
Free
(True/False)
4.8/5
(85)
Correct Answer:
True
The union of two sets is a set that contains only the elements that appear in both sets.
Free
(True/False)
4.8/5
(77)
Correct Answer:
False
The __________ of two sets is a set that contains all the elements of both sets.
(Short Answer)
4.8/5
(86)
Which method would you use to get the value associated with a specific key and remove that key-value pair from the dictionary?
(Multiple Choice)
4.7/5
(78)
What will be the result of the following code?
Ages = {'Aaron' : 6,'Kelly' : 3,'Abigail' : 1 }
Value = ages['Brianna']
(Multiple Choice)
4.8/5
(84)
The built-in function,__________,returns the number of items in a set.
(Short Answer)
4.8/5
(77)
What is the value of the variable phones after the following code executes?
Phones = {'John' : '5555555','Julie' : '5557777'}
Phones['John'] = 5556666'
(Multiple Choice)
4.9/5
(81)
Which would you use to delete an existing key-value pair from a dictionary?
(Multiple Choice)
4.9/5
(87)
The difference of set1 and aet2 is a set that contains only the elements that appear in set1 but do not appear in set2.
(True/False)
4.7/5
(101)
Which would you use to get the number of elements in a dictionary?
(Multiple Choice)
4.8/5
(78)
What does the get method do if the specified key is not found in the dictionary?
(Multiple Choice)
4.9/5
(71)
In order to avoid KeyError exceptions,you can check whether a key is in the dictionary using the __________ operator.
(Multiple Choice)
4.9/5
(81)
To write an object to a file,you use the __________ function of the __________ module.
(Short Answer)
4.9/5
(67)
The __________ method returns all of a dictionary's keys as a dictionary view.
(Short Answer)
5.0/5
(68)
You would typically use a for loop to iterate over the elements in a set.
(True/False)
4.8/5
(83)
A(n)__________ is an object that holds multiple unique items of data in an unordered manner.
(Short Answer)
4.9/5
(71)
Showing 1 - 20 of 39
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)