Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Multiple Choice Questions (Python Data Structures) 2. The method that is respons

ID: 3602511 • Letter: M

Question

Multiple Choice Questions (Python Data Structures)

2. The method that is responsible for setting the initial state of an object’s instance

variables is the

a. __init__ method

b. __str__ method

3. The method that allows a programmer to visit each item in a collection is the

a. __init__ method

b. __iter__ method

4. Methods that change the internal state of an object are its

a. Accessor methods

b. Mutator methods

5. The set of methods available to the user of a class is called its

a. Implementation

b. Interface

6. Polymorphism is a term that refers to the use of

a. The same method names in multiple classes

b. One class to represent the data contained in another class

7. Composition is a term that refers to a

a. Part-whole relationship among two classes

b. Many-to-one relationship among two classes

Explanation / Answer

2. a. __init__ method
3. b. __iter__ method
4. b. Mutator methods
5. b. Interface
6. b. One class to represent the data contained in another class
7. b. Many-to-one relationship among two classes

**Comment for any further queries.