OOP Conceptual Questions


Questions

  1. A class definition provides a pattern for creating objects, but doesn’t make any objects itself. (T/F)
  2. By convention, Python class names start with a lowercase letter. (T/F)
  3. When you define a method in a class, all objects of that class have that method associated with it. (T/F)
  4. The first parameter of a method is a copy of the object the method is called on called self. (T/F)
  5. A class definition must come before an object of that class is instantiated. (T/F)
  6. You must have an instance of a class (an object) to call the class’s constructor. (T/F)
  7. Constructors must have the self parameter in their signature. (T/F)
  8. Constructors must take at least one parameter other than the self parameter. (T/F)
  9. Objects are passed into functions by reference. (T/F)
  10. The type of an object is the same as the name of the class it is an instance of. (T/F)
  11. __init__ doesn’t take self as an argument when the constructor is called, but it does have it as a parameter. (T/F)
  12. __init__ doesn’t contain a return statement, but it does return something. (T/F)
  13. Similar to how a function is first defined then called, a class is first defined then ____.

Answers

  1. True
  2. False
  3. True
  4. False
  5. True
  6. False
  7. True
  8. False
  9. True
  10. True
  11. True
  12. True
  13. Instantiated
Contributor(s): David Karash, Megan Zhang, Alyssa Lytle