题目
单项选择题
MutableMapping class provides concrete implementations for all behaviors other than the first five outlined earlier: 1._______ 2._______, 3.delitem, 4.len, and 5.iter. 2 essential methods are missing from this ADT, rest are there. Fill in the missing methods by selecting one of the choices.
选项
A.1.getitem,
2.setitem,
B.1.delitem,
2.setitem
C.1.balanceitem,
2.rotateitem,
D.1.get_heightitem,
2.priority_queue_item,
查看解析
标准答案
Please login to view
思路分析
We start by restating the question to ensure clarity: The MutableMapping class provides concrete implementations for all behaviors other than the first five outlined earlier, which are labeled as 1. ___ and 2. ___, followed by 3. delitem, 4. len, and 5. iter. Two essential methods are missing from this Abstract Data Type (ADT); we must select the pair that fills in the blanks from the given options.
Option 1: '1.getitem, 2.setitem,'
This pairing suggests that the missing methods are __getitem__ and __setitem__, which are the standard methods for item access and item assignment in Python mappings. __g......Login to view full explanation登录即可查看完整答案
我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。
类似问题
What statement accurately describes the difference between a list and a dictionary?
A data structure is a simple unit that consists of one chunk of data only.
A data structure, such as a tuple, list or dictionary, controls the flow of logic in a module?
Sorted arrays and binary search trees can both be used as a dictionary data structure. Suppose that a dictionary is required to store n items that will be inserted in a randomized order. Which statement is not correct?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!