GIAC
GPYC · Question #41
Review the following Python code: hr = set([('Smith', 'Johnson', 'Williams', 'Jones')]) it = set(['Johnson', 'Jones', 'Brown']) x = hr.intersection(it)
The correct answer is A. 'Jones', 'Johnson'. You've hit your limit · resets 1pm (America/New_York)
Python Fundamentals & Command Line Tools
Question
Review the following Python code:
hr = set([('Smith', 'Johnson', 'Williams', 'Jones')])
it = set(['Johnson', 'Jones', 'Brown'])
x = hr.intersection(it)
Options
- A'Jones', 'Johnson'
- B'Brown'/'Williams'
- C'Brown'/ 'Jones','Johnson','Williams'
- D'Johnson'/ 'JohnsonVilliams'/'Jones'/'Jones'/'Brown'
How the community answered
(33 responses)- A82% (27)
- B3% (1)
- C9% (3)
- D6% (2)
Explanation
You've hit your limit · resets 1pm (America/New_York)
Topics
#sets#intersection#tuple vs list#collections
Community Discussion
No community discussion yet for this question.