Questions
- A class definition provides a pattern for creating objects, but doesn’t make any objects itself. (T/F)
- By convention, Python class names start with a lowercase letter. (T/F)
- When you define a method in a class, all objects of that class have that method associated with it. (T/F)
- The first parameter of a method is a copy of the object the method is called on called
self
. (T/F)
- A class definition must come before an object of that class is instantiated. (T/F)
- You must have an instance of a class (an object) to call the class’s constructor. (T/F)
- Constructors must have the
self
parameter in their signature. (T/F)
- Constructors must take at least one parameter other than the self parameter. (T/F)
- Objects are passed into functions by reference. (T/F)
- The type of an object is the same as the name of the class it is an instance of. (T/F)
__init__
doesn’t take self
as an argument when the constructor is called, but it does have it as a parameter. (T/F)
__init__
doesn’t contain a return
statement, but it does return something. (T/F)
- Similar to how a function is first defined then called, a class is first defined then ____.
Answers
- True
- False
- True
- False
- True
- False
- True
- False
- True
- True
- True
- True
- Instantiated
Contributor(s): David Karash, Megan Zhang, Alyssa Lytle