INF1511-MCQ-PACK.
Which of the following are true for objects of Python’s set type: The order of elements in a set is significant. A given element can’t appear in a set more than once. A set may contain elements that are mutable. Sets are mutable. 2. Which of the following define the set {'a', 'b', 'c'}: s = {('a', 'b', 'c')} s = set('a', 'b', 'c') s = {'a', 'b', 'c'} s = set('abc') s = set(['a', 'b', 'c']) 3. What Python expression tests whether the string 'foo' is a member of set s? 'foo' in s 4. You have a set s defined as follows: s = {100, 200, 300} Which one of the following statements does not correctly produce the union of s and the set {300, 400, 500}: s | [300, 400, 500] s | {300, 400, 500} ({300, 400, 500}) s | set([300, 400, 500]) ([300, 400, 500]) (set([300, 400, 500])) I
Written for
- Institution
- University of South Africa
- Course
- INF1511 - Visual Programming I
Document information
- Uploaded on
- November 26, 2021
- Number of pages
- 15
- Written in
- 2021/2022
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
inf1511 mcq pack