Title: Competency 10 Practice Quiz
Course: Programming Fundamentals I > Section: Practice Quizzes

Q: A/An __________ is a software entity that contains both data and procedures
A: object

Q: ____________ is the combining of data and code into a single object
A: Encapsulation

Q: What is the purpose of the __init__ method?
Feedback: To initialize an object’s data attributes

Q: What is the purpose of the self parameter in a method?
Feedback: Reference the specific object that the method is supposed to operate on

Q: In a Python class, how do you hide an attribute from code outside the class?
Feedback: By starting the attribute’s name with two underscores

Q: What is the purpose of the __str__ method?
Feedback: It returns a string representation of the object

Q: How do you call the __str__ method?
Feedback: By passing the object to the built-in str method

Q: What is an instance attribute?
Feedback: An attribute that belongs to a specific instance of a class

Q: A program creates 10 instances of the Coin class. How many __sideup attributes exist in memory?
Feedback: 10

Q: What is the accessor method?
Feedback: A method that returns a value from a class’s attribute but does not change it