GIAC
GPYC · Question #6
Review the following code, written in Python. What are the contents of variable a? a = set(['cat', 'dog', 'bird']) b = set(['violet', 'rose', 'dandelion']) a.update(b)
The correct answer is B. 'dandelion', 'rose', 'cat', 'violet', 'bird', 'dog'. You've hit your limit · resets 1pm (America/New_York)
Python Fundamentals & Command Line Tools
Question
Review the following code, written in Python. What are the contents of variable a?
a = set(['cat', 'dog', 'bird'])
b = set(['violet', 'rose', 'dandelion'])
a.update(b)
Options
- A'cat'/'dog'/'bird'/'violet'
- B'dandelion', 'rose', 'cat', 'violet', 'bird', 'dog'
- C'violet'/'rose'/'dandelion'
- D'cat'/'dog'/'bird'
How the community answered
(41 responses)- A2% (1)
- B88% (36)
- C7% (3)
- D2% (1)
Explanation
You've hit your limit · resets 1pm (America/New_York)
Topics
#sets#set.update()#set operations#collections
Community Discussion
No community discussion yet for this question.