题目
题目

Fal25_CS003C_74229 Ch. 8 pre-Quiz (Remotely Proctored)

单项选择题

Which of the following is a possible output after the following code snippet is executed? names = set(["Jane", "Joe", "Amy", "Lisa"]) names.add("Amber") names.add("Zoe") names.discard("Joe") print(names)

选项
A.{'Amy', 'Lisa', 'Jane', 'Zoe', 'Amber'}
B.{'Jane', 'Joe', 'Amy', 'Lisa', 'Amber', 'Zoe'}
C.{'Jane', 'Joe', 'Amy', 'Lisa'}
D.{'Jane', 'Joe', 'Amy', 'Lisa', 'Amber'}
查看解析

查看解析

标准答案
Please login to view
思路分析
In this problem, we start with a set containing four names, then add two more names and remove one name, and finally print the resulting set. Because sets are unordered collections, the printed representation can show the elements in any order, but the content must reflect the exact elements remaining after the operations. Option 1: {'Amy', 'Lisa', 'Jane', 'Zoe', 'Amber......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!