题目
题目

Fal25_CS003C_74229 Ch. 8 pre-Quiz (Remotely Proctored)

单项选择题

What is in the set fruit after the following code snippet? fruit2 = set(["blueberry", "lemon", "grapes"]) fruit3 = set(["apple", "banana", "pears", "kiwi"]) fruit = fruit2.union(fruit3)

选项
A.{'blueberry', 'lemon', 'grapes', 'apple', 'banana', 'pears', 'kiwi'}
B.{'blueberry', 'lemon', 'grapes'}
C.{}
D.{'apple', 'banana', 'pears', 'kiwi'}
查看解析

查看解析

标准答案
Please login to view
思路分析
The question asks what the result is from taking the union of two sets in Python. First, restating the given data: fruit2 is a set containing 'blueberry', 'lemon', and 'grapes'. fruit3 is a set containing 'apple', 'banana', 'pears', and 'kiwi'. The operation performed is fruit2.union(fruit3), and the variable fruit will hold the resulting set. Option 1: {'blueberry', 'lemo......Login to view full explanation

登录即可查看完整答案

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

更多留学生实用工具

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